UNPKG

unleash-server

Version:

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

20 lines 665 B
import supertest from 'supertest'; import express from 'express'; import noAuthentication from './no-authentication.js'; test('should add dummy user object to all requests', () => { expect.assertions(1); const app = express(); noAuthentication('', app); app.get('/api/admin/test', (req, res) => { const user = { ...req.user }; return res.status(200).json(user).end(); }); const request = supertest(app); return request .get('/api/admin/test') .expect(200) .expect((res) => { expect(res.body.username === 'unknown').toBe(true); }); }); //# sourceMappingURL=no-authentication.test.js.map