Skip to content

Commit 3e3439f

Browse files
committed
chore(tailwind): Improve code for running Tailwind integration test (#1935)
1 parent afe8b74 commit 3e3439f

File tree

5 files changed

+84
-571
lines changed

5 files changed

+84
-571
lines changed

packages/tailwind/integrations/integrations.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
import { spawnSync } from 'node:child_process';
21
import path from 'node:path';
2+
import shell from 'shelljs';
33

44
const $ = (command: string, cwd: string = path.resolve(__dirname, '..')) => {
5-
process.stderr.write(`${cwd} $ ${command}\n`);
6-
const returns = spawnSync(command, {
7-
shell: true,
5+
const executionResult = shell.exec(command, {
86
cwd,
9-
stdio: 'inherit',
7+
fatal: true,
8+
silent: true,
109
});
10+
if (executionResult.code !== 0) {
11+
process.stdout.write(executionResult.stderr);
12+
process.stderr.write(executionResult.stderr);
13+
}
1114
expect(
12-
returns.status,
15+
executionResult.code,
1316
`Expected command "${command}" to work properly but it returned a non-zero exit code`,
1417
).toBe(0);
1518
};

0 commit comments

Comments
 (0)