UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature toggles service. It provides different strategies for handling feature toggles.

34 lines 1.41 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const database_init_1 = __importDefault(require("../../helpers/database-init")); const no_logger_1 = __importDefault(require("../../../fixtures/no-logger")); const test_helper_1 = require("../../helpers/test-helper"); const validate_1 = require("../../../../lib/openapi/validate"); const feature_types_schema_1 = require("../../../../lib/openapi/spec/feature-types-schema"); let app; let db; beforeAll(async () => { db = await (0, database_init_1.default)('feature_type_api_serial', no_logger_1.default); app = await (0, test_helper_1.setupApp)(db.stores); }); afterAll(async () => { await app.destroy(); await db.destroy(); }); test('Should get all defined feature types', async () => { await app.request .get('/api/admin/feature-types') .expect(200) .expect('Content-Type', /json/) .expect((res) => { const { version, types } = res.body; expect(version).toBe(1); expect(types.length).toBe(5); expect(types[0].name).toBe('Release'); expect((0, validate_1.validateSchema)(feature_types_schema_1.featureTypesSchema.$id, res.body)).toBeUndefined(); }); }); //# sourceMappingURL=feature-type.test.js.map