Skip to content

Commit

Permalink
remove execa from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alec-chernicki committed Dec 21, 2023
1 parent 4ba622e commit 36b6e87
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions apps/commonality/test/integration/studio.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, test, expect, vi } from 'vitest';
import fs from 'fs-extra';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { execa } from 'execa';
import { exec } from 'node:child_process';
import os from 'node:os';
import getPort from 'get-port';
import stripAnsi from 'strip-ansi';
Expand All @@ -26,12 +26,10 @@ describe.concurrent('studio', () => {
);
await fs.copy(fixturePath, temporaryPath);

const cliProcess = execa(
binPath,
['studio', '--debug', '--port', String(preferredPort), '--install'],
const cliProcess = exec(
`${binPath} studio --debug --port ${String(preferredPort)} --install`,
{
cwd: temporaryPath,
stdout: 'pipe',
},
);

Expand Down Expand Up @@ -71,9 +69,7 @@ describe.concurrent('studio', () => {
{ timeout: 100_000 },
);

cliProcess.kill('SIGTERM', {
forceKillAfterTimeout: 2000,
});
cliProcess.kill();

await vi.waitFor(() => {
expect(output).toContain(`Successfully exited Commonality Studio`);
Expand All @@ -99,12 +95,10 @@ describe.concurrent('studio', () => {
);
await fs.copy(fixturePath, temporaryPath);

const cliProcess = execa(
binPath,
['studio', '--debug', '--port', String(preferredPort), '--install'],
const cliProcess = exec(
`${binPath} studio --debug --port ${String(preferredPort)} --install`,
{
cwd: temporaryPath,
stdout: 'pipe',
},
);

Expand Down Expand Up @@ -143,9 +137,7 @@ describe.concurrent('studio', () => {
{ timeout: 100_000 },
);

cliProcess.kill('SIGTERM', {
forceKillAfterTimeout: 2000,
});
cliProcess.kill();

await vi.waitFor(() => {
expect(output).toContain(`Successfully exited Commonality Studio`);
Expand All @@ -171,12 +163,10 @@ describe.concurrent('studio', () => {
);
await fs.copy(fixturePath, temporaryPath);

const cliProcess = execa(
binPath,
['studio', '--debug', '--port', String(preferredPort), '--install'],
const cliProcess = exec(
`${binPath} studio --debug --port ${String(preferredPort)} --install`,
{
cwd: temporaryPath,
stdout: 'pipe',
},
);

Expand Down Expand Up @@ -215,9 +205,7 @@ describe.concurrent('studio', () => {
{ timeout: 100_000 },
);

cliProcess.kill('SIGTERM', {
forceKillAfterTimeout: 2000,
});
cliProcess.kill();

await vi.waitFor(() => {
expect(output).toContain(`Successfully exited Commonality Studio`);
Expand Down

0 comments on commit 36b6e87

Please sign in to comment.