diff --git a/spec/server_test.js b/spec/server_test.js index 9c7ac5c57f7a3b74de2527fe35b3636e5da87e36..ac2daf94a5197651d01fcb00bf737d7cbe7d76fd 100644 --- a/spec/server_test.js +++ b/spec/server_test.js @@ -86,26 +86,31 @@ describe('Manifest service', () => { expect(response2.body).toEqual([{ namespace: 'other', path: 'example' }]) }) - it.skip('can load multiple configurations', async () => { + it('can load multiple configurations', async () => { mockfs({ './config/manifests': { 'urls.yaml': `manifests: - - https://some-fake-url.k3s.de/api/manifest.json - - https://some-other-fake-url.k3s.de/api/manifest.json` + - http://localhost:${port}/api/manifest.json + - http://localhost:${port}/api/no2/manifest.json` } }) mockserver.close() mockserver = await createMockServer({ port }) - mockserver.respondWith({ '/api/manifest.json': { some: 'other' } }) + mockserver.respondWith({ '/api/manifest.json': generateSimpleViteManifest({ 'example1.js': 'other' }) }) + mockserver.respondWith({ '/api/no2/manifest.json': generateSimpleViteManifest({ 'example2.js': 'thing' }) }) + process.env.CACHE_TTL = 1 const app = createApp() await request(app) .get('/api/manifest.json') .then(response => { expect(response.statusCode).toBe(200) - expect(response.body).toEqual([{ some: 'thing"}' }, { some: 'other"}' }]) + expect(response.body).toEqual([ + { namespace: 'other', path: 'example1' }, + { namespace: 'thing', path: 'example2' } + ]) }) }) })