authelia/test/unit/server/mocks/IdentityValidator.ts

39 lines
1.1 KiB
TypeScript
Raw Normal View History

2017-05-21 20:45:54 +00:00
import sinon = require("sinon");
import { IdentityValidable } from "../../../../src/server/lib/IdentityCheckMiddleware";
2017-05-21 20:45:54 +00:00
import express = require("express");
import BluebirdPromise = require("bluebird");
import { Identity } from "../../../../src/types/Identity";
2017-05-21 20:45:54 +00:00
export interface IdentityValidableMock {
challenge: sinon.SinonStub;
preValidationInit: sinon.SinonStub;
preValidationResponse: sinon.SinonStub | sinon.SinonSpy;
postValidationInit: sinon.SinonStub;
postValidationResponse: sinon.SinonStub | sinon.SinonSpy;
2017-05-21 20:45:54 +00:00
mailSubject: sinon.SinonStub;
}
export function IdentityValidableMock() {
return {
challenge: sinon.stub(),
preValidationInit: sinon.stub(),
preValidationResponse: sinon.stub(),
postValidationInit: sinon.stub(),
postValidationResponse: sinon.stub(),
2017-05-21 20:45:54 +00:00
mailSubject: sinon.stub()
};
}
export interface IdentityValidatorMock {
consume_token: sinon.SinonStub;
issue_token: sinon.SinonStub;
}
export function IdentityValidatorMock() {
return {
consume_token: sinon.stub(),
issue_token: sinon.stub()
};
}