diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2024-08-20 10:11:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-20 14:11:43 +0000 |
| commit | f1c58ec041a05276d9f33562a5843c0bb7fb95b3 (patch) | |
| tree | dc4bca4eab617e75474e19a7491ed88d5ee64fef /tests/specs/run/workspaces | |
| parent | 19bcb40059f6ba730b6d05d8edf005c6b40f6ff8 (diff) | |
feat(unstable): ability to use a local copy of jsr packages (#25068)
Diffstat (limited to 'tests/specs/run/workspaces')
9 files changed, 70 insertions, 0 deletions
diff --git a/tests/specs/run/workspaces/member_not_match_constraint/__test__.jsonc b/tests/specs/run/workspaces/member_not_match_constraint/__test__.jsonc new file mode 100644 index 000000000..532705939 --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "test", + "output": "test.out" +} diff --git a/tests/specs/run/workspaces/member_not_match_constraint/add/deno.json b/tests/specs/run/workspaces/member_not_match_constraint/add/deno.json new file mode 100644 index 000000000..ff1abb9fe --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/add/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@denotest/add", + "version": "2.0.0", + "exports": "./mod.ts" +} diff --git a/tests/specs/run/workspaces/member_not_match_constraint/add/mod.ts b/tests/specs/run/workspaces/member_not_match_constraint/add/mod.ts new file mode 100644 index 000000000..2c8d7ef7a --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/add/mod.ts @@ -0,0 +1,4 @@ +export function add(a: number, b: number): number { + console.log("local"); + return a + b; +} diff --git a/tests/specs/run/workspaces/member_not_match_constraint/deno.json b/tests/specs/run/workspaces/member_not_match_constraint/deno.json new file mode 100644 index 000000000..ec5dc2bdf --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/deno.json @@ -0,0 +1,3 @@ +{ + "workspace": ["./add", "./subtract"] +} diff --git a/tests/specs/run/workspaces/member_not_match_constraint/deno.lock b/tests/specs/run/workspaces/member_not_match_constraint/deno.lock new file mode 100644 index 000000000..373359d72 --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/deno.lock @@ -0,0 +1,23 @@ +{ + "version": "3", + "packages": { + "specifiers": { + "jsr:@denotest/add@1": "jsr:@denotest/add@1.0.0" + }, + "jsr": { + "@denotest/add@1.0.0": { + "integrity": "3b2e675c1ad7fba2a45bc251992e01aff08a3c974ac09079b11e6a5b95d4bfcb" + } + } + }, + "remote": {}, + "workspace": { + "members": { + "subtract": { + "dependencies": [ + "jsr:@denotest/add@1" + ] + } + } + } +} diff --git a/tests/specs/run/workspaces/member_not_match_constraint/subtract/deno.json b/tests/specs/run/workspaces/member_not_match_constraint/subtract/deno.json new file mode 100644 index 000000000..e585197c0 --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/subtract/deno.json @@ -0,0 +1,8 @@ +{ + "name": "@denotest/subtract", + "version": "1.0.0", + "exports": "./mod.ts", + "imports": { + "@denotest/add": "jsr:@denotest/add@1" + } +} diff --git a/tests/specs/run/workspaces/member_not_match_constraint/subtract/mod.test.ts b/tests/specs/run/workspaces/member_not_match_constraint/subtract/mod.test.ts new file mode 100644 index 000000000..7d699d4d7 --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/subtract/mod.test.ts @@ -0,0 +1,7 @@ +import { subtract } from "./mod.ts"; + +Deno.test("subtract", () => { + if (subtract(3, 2) !== 1) { + throw new Error("fail"); + } +}); diff --git a/tests/specs/run/workspaces/member_not_match_constraint/subtract/mod.ts b/tests/specs/run/workspaces/member_not_match_constraint/subtract/mod.ts new file mode 100644 index 000000000..6e301511b --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/subtract/mod.ts @@ -0,0 +1,5 @@ +import { add } from "@denotest/add"; + +export function subtract(a: number, b: number): number { + return add(a, -b); +} diff --git a/tests/specs/run/workspaces/member_not_match_constraint/test.out b/tests/specs/run/workspaces/member_not_match_constraint/test.out new file mode 100644 index 000000000..0e16426c6 --- /dev/null +++ b/tests/specs/run/workspaces/member_not_match_constraint/test.out @@ -0,0 +1,11 @@ +Warning Workspace member '@denotest/add@2.0.0' was not used because it did not match '@denotest/add@1' + at file:///[WILDLINE]/mod.ts:1:21 +Download http://127.0.0.1:4250/@denotest/add/meta.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +Check file:///[WILDLINE]/mod.test.ts +running 1 test from ./subtract/mod.test.ts +subtract ... ok ([WILDLINE]) + +ok | 1 passed | 0 failed ([WILDLINE]) + |
