mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
d8ff186303
Client and server now have their own tsconfig so that the transpilation is only done on the part that is being modified. It also allows faster transpilation since tests are now excluded from tsconfig. They are compiled by ts-node during unit tests execution.
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
|
|
import sinon = require("sinon");
|
|
import { IdentityValidable } from "../../src/lib/IdentityCheckMiddleware";
|
|
import express = require("express");
|
|
import BluebirdPromise = require("bluebird");
|
|
import { Identity } from "../../types/Identity";
|
|
|
|
|
|
export interface IdentityValidableMock {
|
|
challenge: sinon.SinonStub;
|
|
preValidationInit: sinon.SinonStub;
|
|
preValidationResponse: sinon.SinonStub | sinon.SinonSpy;
|
|
postValidationInit: sinon.SinonStub;
|
|
postValidationResponse: sinon.SinonStub | sinon.SinonSpy;
|
|
mailSubject: sinon.SinonStub;
|
|
}
|
|
|
|
export function IdentityValidableMock() {
|
|
return {
|
|
challenge: sinon.stub(),
|
|
preValidationInit: sinon.stub(),
|
|
preValidationResponse: sinon.stub(),
|
|
postValidationInit: sinon.stub(),
|
|
postValidationResponse: sinon.stub(),
|
|
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()
|
|
};
|
|
} |