Skip to content

Commit

Permalink
Add long running test. Utilize cross-org standard workflow for ci..
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Oct 6, 2024
1 parent c771385 commit 7446e80
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 87 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/bun.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/deno.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/node.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]

jobs:
deno_ci:
uses: cross-org/workflows/.github/workflows/deno-ci.yml@main
with:
entrypoint: mod.ts
lint_docs: false
bun_ci:
uses: cross-org/workflows/.github/workflows/bun-ci.yml@main
with:
jsr_dependencies: "@std/assert"
node_ci:
uses: cross-org/workflows/.github/workflows/node-ci.yml@main
with:
test_target: "test/*.test.ts"
jsr_dependencies: "@std/assert"
12 changes: 10 additions & 2 deletions mod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ test("Multiplication with timeout", () => {
assertEquals(5 * 4, 20);
}, { timeout: 1000 });

// Test with done callback (useful for async operations)
test("Async test", (_context, done) => {
// Failing async test with done callback
test("Long async test", (_context, done) => {
setTimeout(() => {
assertNotEquals(5, 4);
done(); // Signal test completion
}, 500);
}, { waitForCallback: true });

// Test with done callback (useful for async operations)
test("Async test", (_context, done) => {
setTimeout(() => {
assertNotEquals(5, 4);
done(); // Signal test completion
}, 4500);
}, { waitForCallback: true, timeout: 5500 });

// Test async
import { delay } from "@std/async";
test("async hello world", async () => {
Expand Down

0 comments on commit 7446e80

Please sign in to comment.