From d3a39fe3cfe41fea1f9d21eda31e279f77d4d608 Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Wed, 4 Nov 2026 10:47:15 +0100 Subject: [PATCH] test: stage the legal files in the launcher archive fixture build-server-archive.mjs now requires LICENSE and THIRD_PARTY_NOTICES.md, so the installer fixture stages both and checks that they land next to service.js. The sidecar half of the legal route test gets the 60 s hook timeout the other full-server suites use. --- packages/launcher/tests/installer.test.ts | 5 +++++ packages/server/tests/local/legal-routes.test.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/launcher/tests/installer.test.ts b/packages/launcher/tests/installer.test.ts index 539b36f..f936d58 100644 --- a/packages/launcher/tests/installer.test.ts +++ b/packages/launcher/tests/installer.test.ts @@ -168,6 +168,8 @@ describe.skipIf(!target)('install, update and uninstall from a packed archive', fs.writeFileSync(path.join(resources, process.platform === 'win32' ? 'node.exe' : 'node'), 'not a real runtime'); fs.writeFileSync(path.join(resources, 'service.js'), 'console.log("service");\n'); fs.writeFileSync(path.join(resources, 'service.js.map'), '{}'); + fs.writeFileSync(path.join(resources, 'LICENSE'), 'MIT License\n'); + fs.writeFileSync(path.join(resources, 'THIRD_PARTY_NOTICES.md'), '# Third-party notices\n'); fs.writeFileSync(path.join(web, 'index.html'), ''); const out = path.join(work, 'out'); const result = spawnSync( @@ -203,6 +205,9 @@ describe.skipIf(!target)('install, update and uninstall from a packed archive', expect(fs.readFileSync(path.join(layout.appDir, 'service.js'), 'utf8')).toContain('service'); expect(fs.existsSync(path.join(layout.appDir, 'web', 'index.html'))).toBe(true); expect(fs.existsSync(path.join(layout.appDir, 'service.js.map'))).toBe(false); + // UF-059: the license and the notices are installed next to service.js. + expect(fs.readFileSync(path.join(layout.appDir, 'THIRD_PARTY_NOTICES.md'), 'utf8')).toContain('Third-party notices'); + expect(fs.existsSync(path.join(layout.appDir, 'LICENSE'))).toBe(true); expect(fs.readFileSync(layout.launcherFile, 'utf8')).toBe('// bundled tool\n'); const record = readRecord(layout); expect(record).toMatchObject({ version: VERSION, target, source: archive }); diff --git a/packages/server/tests/local/legal-routes.test.ts b/packages/server/tests/local/legal-routes.test.ts index df606a2..838b012 100644 --- a/packages/server/tests/local/legal-routes.test.ts +++ b/packages/server/tests/local/legal-routes.test.ts @@ -95,7 +95,7 @@ describe('legal routes in the sidecar', () => { vi.stubEnv('WAGGLE_TRUST_LOCALHOST', '0'); dataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-legal-server-')); server = await buildLocalServer({ dataDir }); - }); + }, 60_000); afterAll(async () => { await server.close();