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 <[email protected]>
  • Loading branch information
Tomas2D committed Oct 24, 2024
1 parent 2e0ce70 commit 512fa28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/vitest.examples.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default defineConfig({
test: {
globals: true,
passWithNoTests: true,
testTimeout: 120 * 1000,
testTimeout: 10 * 60 * 1000,
printConsoleTrace: true,
setupFiles: ["./tests/setup.examples.ts"],
deps: {
Expand Down
12 changes: 4 additions & 8 deletions tests/examples/examples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,16 @@ describe("E2E Examples", async () => {

it.concurrent.each(exampleFiles)(`Run %s`, async (example) => {
await execAsync(`yarn start -- ${example} <<< "Hello world"`)
.then((stdout) => {
.then(({ stdout, stderr }) => {
// eslint-disable-next-line no-console
console.log({
path: example,
result: stdout.stdout,
error: stdout.stderr,
});
expect(stdout.stderr).toBeFalsy();
console.log("STDOUT:", stdout);
expect(stderr).toBeFalsy();
})
.catch((_e) => {
const error = _e as ExecException;

// eslint-disable-next-line no-console
console.error("STDOUT:", error.stderr);
console.error("STDOUT:", error.stdout);

expect(error.stderr).toBeFalsy();
expect(error.code).toBe(0);
Expand Down

0 comments on commit 512fa28

Please sign in to comment.