Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): --port option #643

Merged
merged 4 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix e2e
  • Loading branch information
dai-shi committed Apr 1, 2024
commit 82045e15b6d284935fa983b2a27410b949770058
12 changes: 2 additions & 10 deletions e2e/07_router_standalone.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,9 @@ test.describe('07_router standalone', () => {
);
const port = await getFreePort();
const cp = exec(
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} start`,
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} start --port ${port}`,
{
cwd: standaloneDir,
env: {
...process.env,
PORT: `${port}`,
},
},
);
debugChildProcess(cp, fileURLToPath(import.meta.url));
Expand All @@ -95,13 +91,9 @@ test.describe('07_router standalone', () => {
test.fixme(withSSR, 'SSR is not working in standalone');
const port = await getFreePort();
const cp = exec(
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} dev`,
`node ${join(standaloneDir, './node_modules/waku/dist/cli.js')} dev --port ${port}`,
{
cwd: standaloneDir,
env: {
...process.env,
PORT: `${port}`,
},
},
);
debugChildProcess(cp, fileURLToPath(import.meta.url));
Expand Down
12 changes: 2 additions & 10 deletions e2e/examples-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,8 @@ for (const cwd of examples) {
});
}
port = await getFreePort();
cp = exec(command, {
cp = exec(`${command} --port ${port}`, {
cwd,
env: {
...process.env,
PORT: `${port}`,
},
});
debugChildProcess(cp, fileURLToPath(import.meta.url));
await waitPort({
Expand Down Expand Up @@ -116,12 +112,8 @@ for (const cwd of examples) {
});
}
port = await getFreePort();
cp = exec(`node ${waku} ${command}`, {
cp = exec(`node ${waku} ${command} --port ${port}`, {
cwd,
env: {
...process.env,
PORT: `${port}`,
},
});
cp.stdout?.on('data', (data) => {
info(`${port} stdout: ${data}`);
Expand Down
6 changes: 1 addition & 5 deletions e2e/rsc-basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ for (const { build, command } of commands) {
});
}
port = await getFreePort();
cp = exec(`node ${waku} ${command}`, {
cp = exec(`node ${waku} ${command} --port ${port}`, {
cwd,
env: {
...process.env,
PORT: `${port}`,
},
});
debugChildProcess(cp, fileURLToPath(import.meta.url));
await waitPort({
Expand Down
6 changes: 1 addition & 5 deletions e2e/rsc-router.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ for (const { build, command } of commands) {
});
}
port = await getFreePort();
cp = exec(`node ${waku} ${command}`, {
cp = exec(`node ${waku} ${command} --port ${port}`, {
cwd,
env: {
...process.env,
PORT: `${port}`,
},
});
debugChildProcess(cp, fileURLToPath(import.meta.url));
await waitPort({
Expand Down
6 changes: 1 addition & 5 deletions e2e/ssr-basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ for (const { build, command } of commands) {
});
}
port = await getFreePort();
cp = exec(`node ${waku} ${command}`, {
cp = exec(`node ${waku} ${command} --port ${port}`, {
cwd,
env: {
...process.env,
PORT: `${port}`,
},
});
debugChildProcess(cp, fileURLToPath(import.meta.url));
await waitPort({
Expand Down
6 changes: 1 addition & 5 deletions e2e/ssr-swr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ for (const { build, command } of commands) {
});
}
port = await getFreePort();
cp = exec(`node ${waku} ${command}`, {
cp = exec(`node ${waku} ${command} --port ${port}`, {
cwd,
env: {
...process.env,
PORT: `${port}`,
},
});
debugChildProcess(cp, fileURLToPath(import.meta.url));
await waitPort({
Expand Down
8 changes: 2 additions & 6 deletions e2e/ssr-target-bundle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ for (const { build, command } of commands) {
});
}
port = await getFreePort();
cp = exec(`node ${waku} ${command}`, {
cp = exec(`node ${waku} ${command} --port ${port}`, {
cwd,
env: {
...process.env,
PORT: `${port}`,
},
});
cp.stdout?.on('data', (data) => {
console.log(`${port} stdout: `, `${data}`);
Expand Down Expand Up @@ -133,7 +129,7 @@ for (const { build, command } of commands) {
const value = await page
.getByTestId('json-public-linked')
.getAttribute('href');
await expect(value).toMatch(/json-public-linked/);
expect(value).toMatch(/json-public-linked/);
});

test('no js environment should have first screen', async ({ browser }) => {
Expand Down
Loading