authelia/test/unitary/mocks/express.ts

31 lines
549 B
TypeScript
Raw Normal View History

2017-05-21 03:55:37 +07:00
import sinon = require("sinon");
2017-05-21 06:15:34 +07:00
export interface RequestMock {
app?: any;
body?: any;
session?: any;
headers?: any;
}
export interface ResponseMock {
send: sinon.SinonStub | sinon.SinonSpy;
status: sinon.SinonStub;
json: sinon.SinonStub;
}
export function RequestMock(): RequestMock {
return {
app: {
get: sinon.stub()
}
};
}
export function ResponseMock(): ResponseMock {
return {
send: sinon.stub(),
status: sinon.stub(),
json: sinon.stub()
};
}