Skip to content

Commit 8db8327

Browse files
committed
Add long running test. Utilize cross-org standard workflow for ci..
1 parent c771385 commit 8db8327

File tree

5 files changed

+34
-88
lines changed

5 files changed

+34
-88
lines changed

.github/workflows/bun.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/deno.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/node.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches: [main, dev]
4+
pull_request:
5+
branches: [main, dev]
6+
7+
jobs:
8+
deno_ci:
9+
uses: cross-org/workflows/.github/workflows/deno-ci.yml@main
10+
with:
11+
entrypoint: mod.ts
12+
lint_docs: false
13+
bun_ci:
14+
uses: cross-org/workflows/.github/workflows/bun-ci.yml@main
15+
with:
16+
jsr_dependencies: "@std/assert @std/async @cross/runtime"
17+
npm_dependencies: "sinon"
18+
node_ci:
19+
uses: cross-org/workflows/.github/workflows/node-ci.yml@main
20+
with:
21+
test_target: "*.test.ts"
22+
jsr_dependencies: "@std/assert @std/async @cross/runtime"
23+
npm_dependencies: "sinon"

mod.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { test } from "./mod.ts";
22
import { assertEquals, assertNotEquals } from "@std/assert";
3+
import { delay } from "@std/async";
34

45
// Simple test
56
test("Multiplication", () => {
@@ -11,16 +12,23 @@ test("Multiplication with timeout", () => {
1112
assertEquals(5 * 4, 20);
1213
}, { timeout: 1000 });
1314

14-
// Test with done callback (useful for async operations)
15-
test("Async test", (_context, done) => {
15+
// Failing async test with done callback
16+
test("Long async test", (_context, done) => {
1617
setTimeout(() => {
1718
assertNotEquals(5, 4);
1819
done(); // Signal test completion
1920
}, 500);
2021
}, { waitForCallback: true });
2122

23+
// Test with done callback (useful for async operations)
24+
test("Async test", (_context, done) => {
25+
setTimeout(() => {
26+
assertNotEquals(5, 4);
27+
done(); // Signal test completion
28+
}, 4500);
29+
}, { waitForCallback: true, timeout: 5500 });
30+
2231
// Test async
23-
import { delay } from "@std/async";
2432
test("async hello world", async () => {
2533
const x = 1 + 2;
2634

0 commit comments

Comments
 (0)