UNPKG

inversify-express-utils

Version:

Some utilities for the development of express applications with Inversify

25 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const globals_1 = require("@jest/globals"); const inversify_1 = require("inversify"); const constants_1 = require("../constants"); const server_1 = require("../server"); const utils_1 = require("../utils"); (0, globals_1.describe)('Issue 590', () => { (0, globals_1.beforeEach)(() => { (0, utils_1.cleanUpMetadata)(); }); (0, globals_1.it)('should throw if no bindings for controllers are declared', () => { const container = new inversify_1.Container(); const server = new server_1.InversifyExpressServer(container); const throws = () => server.build(); (0, globals_1.expect)(throws).toThrowError(constants_1.NO_CONTROLLERS_FOUND); }); (0, globals_1.it)('should not throw if forceControllers is false and no bindings for controllers are declared', () => { const container = new inversify_1.Container(); const server = new server_1.InversifyExpressServer(container, null, null, null, null, false); const throws = () => server.build(); (0, globals_1.expect)(throws).not.toThrowError(); }); }); //# sourceMappingURL=issue_590.test.js.map