mirror of
https://github.com/Silentely/eSIM-Tools.git
synced 2026-09-03 06:24:20 +08:00
41 lines
1009 B
JavaScript
41 lines
1009 B
JavaScript
jest.mock('cheerio', () => ({
|
|
load: () => ({})
|
|
}));
|
|
|
|
describe('Local server route coverage', () => {
|
|
const originalEnv = process.env;
|
|
|
|
beforeEach(() => {
|
|
jest.resetModules();
|
|
process.env = {
|
|
...originalEnv,
|
|
ACCESS_KEY: 'test-access-key',
|
|
ALLOWED_ORIGIN: 'https://esim.cosr.eu.org',
|
|
SIMYO_CLIENT_TOKEN: 'test-simyo-token'
|
|
};
|
|
});
|
|
|
|
afterEach(() => {
|
|
process.env = originalEnv;
|
|
jest.restoreAllMocks();
|
|
});
|
|
|
|
it('exposes the same BFF targets locally as the production allowlist', () => {
|
|
const app = require('../../server.js');
|
|
const routes = app.locals.bffRoutes;
|
|
|
|
const expectedRoutes = [
|
|
'/bff/giffgaff-token-exchange',
|
|
'/bff/giffgaff-graphql',
|
|
'/bff/giffgaff-mfa-challenge',
|
|
'/bff/giffgaff-mfa-validation',
|
|
'/bff/giffgaff-sms-activate',
|
|
'/bff/auto-activate-esim',
|
|
'/bff/verify-cookie',
|
|
'/bff/public-config'
|
|
];
|
|
|
|
expect([...routes].sort()).toEqual([...expectedRoutes].sort());
|
|
});
|
|
});
|