test(server): expect the source export condition in the sidecar and e2e builds (P2.1)
This commit is contained in:
@@ -499,9 +499,8 @@ describe('Tauri Production Configuration', () => {
|
|||||||
expect(content).toContain("path.join(root, 'packages', 'marketplace', 'marketplace.db')");
|
expect(content).toContain("path.join(root, 'packages', 'marketplace', 'marketplace.db')");
|
||||||
expect(content).not.toContain("'marketplace', 'seed', 'marketplace.db'");
|
expect(content).not.toContain("'marketplace', 'seed', 'marketplace.db'");
|
||||||
expect(content).toContain('Required marketplace database is missing');
|
expect(content).toContain('Required marketplace database is missing');
|
||||||
expect(content).toContain(
|
// Workspace packages compile from src/ through their `source` export (P2.1).
|
||||||
"'@waggle/agent/external-process-env': path.join(root, 'packages', 'agent', 'src', 'external-process-env.ts')",
|
expect(content).toContain("conditions: ['source']");
|
||||||
);
|
|
||||||
|
|
||||||
const serverIndex = fs.readFileSync(
|
const serverIndex = fs.readFileSync(
|
||||||
path.join(ROOT, 'packages', 'server', 'src', 'local', 'index.ts'),
|
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')");
|
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 esbuild = await import('esbuild');
|
||||||
const result = await esbuild.build({
|
const result = await esbuild.build({
|
||||||
stdin: {
|
stdin: {
|
||||||
@@ -526,16 +525,15 @@ describe('Tauri Production Configuration', () => {
|
|||||||
format: 'esm',
|
format: 'esm',
|
||||||
write: false,
|
write: false,
|
||||||
logLevel: 'silent',
|
logLevel: 'silent',
|
||||||
alias: {
|
conditions: ['source'],
|
||||||
'@waggle/agent/external-process-env': path.join(
|
metafile: true,
|
||||||
ROOT, 'packages', 'agent', 'src', 'external-process-env.ts',
|
|
||||||
),
|
|
||||||
'@waggle/agent': path.join(ROOT, 'packages', 'agent', 'src', 'index.ts'),
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result.errors).toEqual([]);
|
expect(result.errors).toEqual([]);
|
||||||
expect(result.outputFiles[0]?.text).toContain('buildExternalProcessEnv');
|
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', () => {
|
it('build-sidecar provenance follows transitive tsconfig inheritance', () => {
|
||||||
@@ -7342,7 +7340,7 @@ describe('Playwright Visual Regression Setup', () => {
|
|||||||
: '"$WAGGLE_E2E_NODE_EXEC"';
|
: '"$WAGGLE_E2E_NODE_EXEC"';
|
||||||
expect(webServer.command).toBe(
|
expect(webServer.command).toBe(
|
||||||
`npm run build:all && ${nodeReference} `
|
`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.command).not.toContain(nodePath);
|
||||||
expect(webServer.reuseExistingServer).toBe(false);
|
expect(webServer.reuseExistingServer).toBe(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user