typescript-helper-functions
Version:
Typescript Helper Functions
39 lines • 1.69 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const orchestrator_1 = require("./orchestrator");
const typescript_ilogger_1 = require("typescript-ilogger");
const logger = new typescript_ilogger_1.Logger(typescript_ilogger_1.LogLevel.Off);
const orchestrator = new orchestrator_1.Orchestrator(logger);
describe(`${orchestrator_1.Orchestrator.name}`, () => {
test('should create class and have logger defined', () => {
const localOrchestrator = new orchestrator_1.Orchestrator(logger);
return expect(localOrchestrator.Logger).toBeDefined();
});
});
describe(`${orchestrator_1.Orchestrator.name}.${orchestrator.Orchestrate.name}`, () => {
test('should return true passing function', () => {
const actual = orchestrator.Orchestrate(() => {
});
return expect(actual).toEqual(true);
});
test('should return false passing function that throws', () => {
const actual = orchestrator.Orchestrate(() => {
throw new Error();
});
return expect(actual).toEqual(false);
});
});
describe(`${orchestrator_1.Orchestrator.name}.${orchestrator.OrchestrateAsync.name}`, () => {
test('should return true passing function - async', () => {
const actual = orchestrator.OrchestrateAsync(async () => {
});
return expect(actual).resolves.toEqual(true);
});
test('should return false passing function that throws - async', () => {
const actual = orchestrator.OrchestrateAsync(async () => {
throw new Error();
});
return expect(actual).resolves.toEqual(false);
});
});
//# sourceMappingURL=orchestrator.spec.js.map
;