Skip to content

Commit 2e0ce70

Browse files
committed
test(examples): update script
Ref: #62 Signed-off-by: Tomas Dvorak <[email protected]>
1 parent 1c9e524 commit 2e0ce70

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/examples/examples.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@
1717
import { expect } from "vitest";
1818
import { exec } from "child_process";
1919
import { glob } from "glob";
20-
import { promisify } from "util";
2120
import { isTruthy } from "remeda";
2221
import { hasEnv } from "@/internals/env.js";
2322
import { ExecException } from "node:child_process";
2423

25-
const execAsync = promisify(exec);
24+
const execAsync = (command: string) =>
25+
new Promise<{ stdout: string; stderr: string }>((resolve, reject) =>
26+
exec(
27+
command,
28+
{
29+
shell: process.env.SHELL || "/bin/bash",
30+
},
31+
(error, stdout, stderr) => (error ? reject(error) : resolve({ stdout, stderr })),
32+
),
33+
);
34+
2635
const includePattern = process.env.INCLUDE_PATTERN || `./examples/**/*.ts`;
2736
const excludePattern = process.env.EXCLUDE_PATTERN || ``;
2837

0 commit comments

Comments
 (0)