diff options
Diffstat (limited to 'tests/specs/test')
| -rw-r--r-- | tests/specs/test/workspace/__test__.jsonc | 20 | ||||
| -rw-r--r-- | tests/specs/test/workspace/deno.json | 6 | ||||
| -rw-r--r-- | tests/specs/test/workspace/package-a/deno.json | 5 | ||||
| -rw-r--r-- | tests/specs/test/workspace/package-a/mod.test.ts | 7 | ||||
| -rw-r--r-- | tests/specs/test/workspace/package-a/mod.ts | 3 | ||||
| -rw-r--r-- | tests/specs/test/workspace/package-b/deno.json | 5 | ||||
| -rw-r--r-- | tests/specs/test/workspace/package-b/mod.test.ts | 11 | ||||
| -rw-r--r-- | tests/specs/test/workspace/package-b/mod.ts | 5 | ||||
| -rw-r--r-- | tests/specs/test/workspace/package_a.out | 6 | ||||
| -rw-r--r-- | tests/specs/test/workspace/package_b.out | 20 | ||||
| -rw-r--r-- | tests/specs/test/workspace/root.out | 23 |
11 files changed, 111 insertions, 0 deletions
diff --git a/tests/specs/test/workspace/__test__.jsonc b/tests/specs/test/workspace/__test__.jsonc new file mode 100644 index 000000000..87fd3d46d --- /dev/null +++ b/tests/specs/test/workspace/__test__.jsonc @@ -0,0 +1,20 @@ +{ + "tests": { + "root": { + "args": "test", + "output": "root.out", + "exitCode": 1 + }, + "package_a": { + "args": "test", + "cwd": "package-a", + "output": "package_a.out" + }, + "package_b": { + "args": "test", + "cwd": "package-b", + "output": "package_b.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/test/workspace/deno.json b/tests/specs/test/workspace/deno.json new file mode 100644 index 000000000..b72d88442 --- /dev/null +++ b/tests/specs/test/workspace/deno.json @@ -0,0 +1,6 @@ +{ + "workspace": [ + "./package-a", + "./package-b" + ] +} diff --git a/tests/specs/test/workspace/package-a/deno.json b/tests/specs/test/workspace/package-a/deno.json new file mode 100644 index 000000000..e6e03ae85 --- /dev/null +++ b/tests/specs/test/workspace/package-a/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@scope/a", + "version": "1.0.0", + "exports": "./mod.ts" +} diff --git a/tests/specs/test/workspace/package-a/mod.test.ts b/tests/specs/test/workspace/package-a/mod.test.ts new file mode 100644 index 000000000..7ef57fbee --- /dev/null +++ b/tests/specs/test/workspace/package-a/mod.test.ts @@ -0,0 +1,7 @@ +import { add } from "./mod.ts"; + +Deno.test("add", () => { + if (add(1, 2) !== 3) { + throw new Error("failed"); + } +}); diff --git a/tests/specs/test/workspace/package-a/mod.ts b/tests/specs/test/workspace/package-a/mod.ts new file mode 100644 index 000000000..8d9b8a22a --- /dev/null +++ b/tests/specs/test/workspace/package-a/mod.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/test/workspace/package-b/deno.json b/tests/specs/test/workspace/package-b/deno.json new file mode 100644 index 000000000..f131c191b --- /dev/null +++ b/tests/specs/test/workspace/package-b/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@scope/b", + "version": "1.0.0", + "exports": "./mod.ts" +} diff --git a/tests/specs/test/workspace/package-b/mod.test.ts b/tests/specs/test/workspace/package-b/mod.test.ts new file mode 100644 index 000000000..f1499a626 --- /dev/null +++ b/tests/specs/test/workspace/package-b/mod.test.ts @@ -0,0 +1,11 @@ +import { addOne } from "./mod.ts"; + +Deno.test("addOne", () => { + if (addOne(1) !== 2) { + throw new Error("failed"); + } +}); + +Deno.test("fail", () => { + throw new Error("failed"); +}); diff --git a/tests/specs/test/workspace/package-b/mod.ts b/tests/specs/test/workspace/package-b/mod.ts new file mode 100644 index 000000000..53148ac2f --- /dev/null +++ b/tests/specs/test/workspace/package-b/mod.ts @@ -0,0 +1,5 @@ +import { add } from "@scope/a"; + +export function addOne(a: number): number { + return add(a, 1); +} diff --git a/tests/specs/test/workspace/package_a.out b/tests/specs/test/workspace/package_a.out new file mode 100644 index 000000000..6ebcdfb10 --- /dev/null +++ b/tests/specs/test/workspace/package_a.out @@ -0,0 +1,6 @@ +Check file:///[WILDLINE]/package-a/mod.test.ts +running 1 test from ./mod.test.ts +add ... ok ([WILDLINE]) + +ok | 1 passed | 0 failed ([WILDLINE]) + diff --git a/tests/specs/test/workspace/package_b.out b/tests/specs/test/workspace/package_b.out new file mode 100644 index 000000000..6c13427ee --- /dev/null +++ b/tests/specs/test/workspace/package_b.out @@ -0,0 +1,20 @@ +Check file:///[WILDLINE]/package-b/mod.test.ts +running 2 tests from ./mod.test.ts +addOne ... ok ([WILDLINE]) +fail ... FAILED ([WILDLINE]) + + ERRORS + +fail => ./mod.test.ts:9:6 +error: Error: failed + throw new Error("failed"); + ^ + at file:///[WILDLINE]/package-b/mod.test.ts:10:9 + + FAILURES + +fail => ./mod.test.ts:9:6 + +FAILED | 1 passed | 1 failed ([WILDLINE]) + +error: Test failed diff --git a/tests/specs/test/workspace/root.out b/tests/specs/test/workspace/root.out new file mode 100644 index 000000000..30bda3ac6 --- /dev/null +++ b/tests/specs/test/workspace/root.out @@ -0,0 +1,23 @@ +Check file:///[WILDLINE]/package-a/mod.test.ts +Check file:///[WILDLINE]/package-b/mod.test.ts +running 1 test from ./package-a/mod.test.ts +add ... ok ([WILDLINE]) +running 2 tests from ./package-b/mod.test.ts +addOne ... ok ([WILDLINE]) +fail ... FAILED ([WILDLINE]) + + ERRORS + +fail => ./package-b/mod.test.ts:9:6 +error: Error: failed + throw new Error("failed"); + ^ + at file:///[WILDLINE]/package-b/mod.test.ts:10:9 + + FAILURES + +fail => ./package-b/mod.test.ts:9:6 + +FAILED | 2 passed | 1 failed ([WILDLINE]) + +error: Test failed |
