Skip to content

Commit

Permalink
log and timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
alec-chernicki committed Dec 20, 2023
1 parent 24c3864 commit d88f283
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/commonality/test/integration/studio.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ describe.concurrent('studio', () => {
let output = '';

cliProcess.stdout?.on('data', (data) => {
console.log({ out: data.toString() });
console.log('pnpm:', data.toString());
output += stripAnsi(data.toString());
});
cliProcess.stderr?.on('data', (data) => {
console.log({ err: data.toString() });
console.log('pnpm:', data.toString());
output += stripAnsi(data.toString());
});

await vi.waitFor(
() => {
expect(output).toContain('📦 Starting Commonality Studio...');
},
{ timeout: 20_000 },
{ timeout: 50_000 },
);

await vi.waitFor(
Expand All @@ -59,7 +59,7 @@ describe.concurrent('studio', () => {
`MISSING DEPENDENCY Cannot find dependency '@commonalityco/studio'`,
);
},
{ timeout: 20_000 },
{ timeout: 50_000 },
);

await vi.waitFor(
Expand All @@ -68,7 +68,7 @@ describe.concurrent('studio', () => {
`Viewable at: http://127.0.0.1:${preferredPort} (press ctrl-c to quit)`,
);
},
{ timeout: 50_000 },
{ timeout: 100_000 },
);

cliProcess.kill('SIGTERM', {
Expand All @@ -83,7 +83,7 @@ describe.concurrent('studio', () => {

await fs.remove(temporaryPath);
},
{ timeout: 100_000 },
{ timeout: 200_000 },
);

test(
Expand All @@ -110,19 +110,19 @@ describe.concurrent('studio', () => {

let output = '';
cliProcess.stdout?.on('data', (data) => {
console.log({ out: data.toString() });
console.log('npm:', data.toString());
output += stripAnsi(data.toString());
});
cliProcess.stderr?.on('data', (data) => {
console.log({ err: data.toString() });
console.log('npm:', data.toString());
output += stripAnsi(data.toString());
});

await vi.waitFor(
() => {
expect(output).toContain('📦 Starting Commonality Studio...');
},
{ timeout: 20_000 },
{ timeout: 50_000 },
);

await vi.waitFor(
Expand All @@ -131,7 +131,7 @@ describe.concurrent('studio', () => {
`MISSING DEPENDENCY Cannot find dependency '@commonalityco/studio'`,
);
},
{ timeout: 20_000 },
{ timeout: 50_000 },
);

await vi.waitFor(
Expand All @@ -140,7 +140,7 @@ describe.concurrent('studio', () => {
`Viewable at: http://127.0.0.1:${preferredPort} (press ctrl-c to quit)`,
);
},
{ timeout: 50_000 },
{ timeout: 100_000 },
);

cliProcess.kill('SIGTERM', {
Expand All @@ -155,7 +155,7 @@ describe.concurrent('studio', () => {

await fs.remove(temporaryPath);
},
{ timeout: 100_000 },
{ timeout: 200_000 },
);

test(
Expand All @@ -182,19 +182,19 @@ describe.concurrent('studio', () => {

let output = '';
cliProcess.stdout?.on('data', (data) => {
console.log({ out: data.toString() });
console.log('yarn:', data.toString());
output += stripAnsi(data.toString());
});
cliProcess.stderr?.on('data', (data) => {
console.log({ err: data.toString() });
console.log('yarn:', data.toString());
output += stripAnsi(data.toString());
});

await vi.waitFor(
() => {
expect(output).toContain('📦 Starting Commonality Studio...');
},
{ timeout: 20_000 },
{ timeout: 50_000 },
);

await vi.waitFor(
Expand All @@ -203,7 +203,7 @@ describe.concurrent('studio', () => {
`MISSING DEPENDENCY Cannot find dependency '@commonalityco/studio'`,
);
},
{ timeout: 20_000 },
{ timeout: 50_000 },
);

await vi.waitFor(
Expand All @@ -212,7 +212,7 @@ describe.concurrent('studio', () => {
`Viewable at: http://127.0.0.1:${preferredPort} (press ctrl-c to quit)`,
);
},
{ timeout: 50_000 },
{ timeout: 100_000 },
);

cliProcess.kill('SIGTERM', {
Expand All @@ -227,6 +227,6 @@ describe.concurrent('studio', () => {

await fs.remove(temporaryPath);
},
{ timeout: 100_000 },
{ timeout: 200_000 },
);
});

0 comments on commit d88f283

Please sign in to comment.