test(server): expect the source export condition in the sidecar and e2e builds (P2.1)

This commit is contained in:
shumeiko.it
2026-10-24 17:44:23 +02:00
parent 60fa8a1c54
commit 77ddfd5b27

View File

@@ -499,9 +499,8 @@ describe('Tauri Production Configuration', () => {
expect(content).toContain("path.join(root, 'packages', 'marketplace', 'marketplace.db')");
expect(content).not.toContain("'marketplace', 'seed', 'marketplace.db'");
expect(content).toContain('Required marketplace database is missing');
expect(content).toContain(
"'@waggle/agent/external-process-env': path.join(root, 'packages', 'agent', 'src', 'external-process-env.ts')",
);
// Workspace packages compile from src/ through their `source` export (P2.1).
expect(content).toContain("conditions: ['source']");
const serverIndex = fs.readFileSync(
path.join(ROOT, 'packages', 'server', 'src', 'local', 'index.ts'),
@@ -510,7 +509,7 @@ describe('Tauri Production Configuration', () => {
expect(serverIndex).toContain("path.resolve(__dirname, 'marketplace.db')");
});
it('build-sidecar exact alias resolves the agent env helper before its root alias', async () => {
it('build-sidecar source condition resolves the agent env helper subpath from src', async () => {
const esbuild = await import('esbuild');
const result = await esbuild.build({
stdin: {
@@ -526,16 +525,15 @@ describe('Tauri Production Configuration', () => {
format: 'esm',
write: false,
logLevel: 'silent',
alias: {
'@waggle/agent/external-process-env': path.join(
ROOT, 'packages', 'agent', 'src', 'external-process-env.ts',
),
'@waggle/agent': path.join(ROOT, 'packages', 'agent', 'src', 'index.ts'),
},
conditions: ['source'],
metafile: true,
});
expect(result.errors).toEqual([]);
expect(result.outputFiles[0]?.text).toContain('buildExternalProcessEnv');
expect(Object.keys(result.metafile?.inputs ?? {})).toContain(
'packages/agent/src/external-process-env.ts',
);
});
it('build-sidecar provenance follows transitive tsconfig inheritance', () => {
@@ -7342,7 +7340,7 @@ describe('Playwright Visual Regression Setup', () => {
: '"$WAGGLE_E2E_NODE_EXEC"';
expect(webServer.command).toBe(
`npm run build:all && ${nodeReference} `
+ 'node_modules/tsx/dist/cli.mjs packages/server/src/local/start.ts --skip-litellm',
+ 'node_modules/tsx/dist/cli.mjs --conditions=source packages/server/src/local/start.ts --skip-litellm',
);
expect(webServer.command).not.toContain(nodePath);
expect(webServer.reuseExistingServer).toBe(false);