component-dbs-core
Version:
DTO objects shared among device backend
35 lines • 1.87 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jwtValidator_1 = __importDefault(require("./jwtValidator"));
const jwtLib_1 = __importDefault(require("./__mocks__/jwtLib"));
const jwtCheckTestSuite_1 = require("./testcases/jwtCheckTestSuite");
describe('JWT validator test suite', () => {
let underTest;
const jwtCheckTestSuite = new jwtCheckTestSuite_1.JwtCheckTestSuite();
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
underTest = new jwtValidator_1.default(new jwtLib_1.default({}));
}));
test.each(jwtCheckTestSuite.params)('%o, %o', (testCase, expected) => __awaiter(void 0, void 0, void 0, function* () {
const testCaseParam = yield jwtCheckTestSuite.getParameterForTestCase(testCase);
try {
const result = yield underTest.validate(testCaseParam);
expect(result).toMatchSnapshot();
}
catch (e) {
expect(e).toMatchSnapshot();
}
}));
});
//# sourceMappingURL=jwtValidator.spec.js.map