Skip to content

Commit

Permalink
test(examples): update script
Browse files Browse the repository at this point in the history
Ref: #62
Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
  • Loading branch information
Tomas2D committed Oct 24, 2024
1 parent 1c9e524 commit 2e0ce70
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/examples/examples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@
import { expect } from "vitest";
import { exec } from "child_process";
import { glob } from "glob";
import { promisify } from "util";
import { isTruthy } from "remeda";
import { hasEnv } from "@/internals/env.js";
import { ExecException } from "node:child_process";

const execAsync = promisify(exec);
const execAsync = (command: string) =>
new Promise<{ stdout: string; stderr: string }>((resolve, reject) =>
exec(
command,
{
shell: process.env.SHELL || "/bin/bash",
},
(error, stdout, stderr) => (error ? reject(error) : resolve({ stdout, stderr })),
),
);

const includePattern = process.env.INCLUDE_PATTERN || `./examples/**/*.ts`;
const excludePattern = process.env.EXCLUDE_PATTERN || ``;

Expand Down

0 comments on commit 2e0ce70

Please sign in to comment.