diff options
Diffstat (limited to 'tests/specs')
19 files changed, 80 insertions, 5 deletions
diff --git a/tests/specs/npm/workspace_basic/__test__.jsonc b/tests/specs/npm/workspace_basic/__test__.jsonc index 79e059ca1..7415a9aeb 100644 --- a/tests/specs/npm/workspace_basic/__test__.jsonc +++ b/tests/specs/npm/workspace_basic/__test__.jsonc @@ -5,6 +5,10 @@ "args": "run --node-modules-dir=false b/main.ts", "output": "b/main_global_cache.out" }, + "global_cache_bare_specifier_not_in_pkg": { + "args": "run --node-modules-dir=false main.ts", + "output": "main.out" + }, "node_modules_dir": { "args": "run --node-modules-dir=true b/main.ts", "output": "b/main_node_modules_dir.out" diff --git a/tests/specs/npm/workspace_basic/b/main.ts b/tests/specs/npm/workspace_basic/b/main.ts index 03956388c..4920b8d6f 100644 --- a/tests/specs/npm/workspace_basic/b/main.ts +++ b/tests/specs/npm/workspace_basic/b/main.ts @@ -1,9 +1,7 @@ import * as a1 from "@denotest/a"; import * as a2 from "npm:@denotest/a@1"; -import * as a3 from "npm:@denotest/a@workspace"; import * as c from "@denotest/c"; a1.sayHello(); a2.sayHello(); -a3.sayHello(); c.sayHello(); diff --git a/tests/specs/npm/workspace_basic/b/main_byonm.out b/tests/specs/npm/workspace_basic/b/main_byonm.out index 3a311dcd7..6520666f7 100644 --- a/tests/specs/npm/workspace_basic/b/main_byonm.out +++ b/tests/specs/npm/workspace_basic/b/main_byonm.out @@ -1,4 +1,3 @@ Hello 5 Hello 5 -Hello 5 C: Hi! diff --git a/tests/specs/npm/workspace_basic/b/main_global_cache.out b/tests/specs/npm/workspace_basic/b/main_global_cache.out index 1ca11026a..203ac5a99 100644 --- a/tests/specs/npm/workspace_basic/b/main_global_cache.out +++ b/tests/specs/npm/workspace_basic/b/main_global_cache.out @@ -2,5 +2,4 @@ Download http://localhost:4260/@denotest/esm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Hello 5 Hello 5 -Hello 5 C: Hi! diff --git a/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out b/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out index 82a49b9fe..eeb455652 100644 --- a/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out +++ b/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out @@ -3,5 +3,4 @@ Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Hello 5 Hello 5 -Hello 5 C: Hi! diff --git a/tests/specs/npm/workspace_basic/main.out b/tests/specs/npm/workspace_basic/main.out new file mode 100644 index 000000000..92404af87 --- /dev/null +++ b/tests/specs/npm/workspace_basic/main.out @@ -0,0 +1,4 @@ +Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz +Hello 5 +C: Hi! diff --git a/tests/specs/npm/workspace_basic/main.ts b/tests/specs/npm/workspace_basic/main.ts new file mode 100644 index 000000000..316503b9c --- /dev/null +++ b/tests/specs/npm/workspace_basic/main.ts @@ -0,0 +1,6 @@ +// should resolve these as bare specifiers within the workspace +import * as a from "@denotest/a"; +import * as c from "@denotest/c"; + +a.sayHello(); +c.sayHello(); diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/__test__.jsonc b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/__test__.jsonc new file mode 100644 index 000000000..8819e630d --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tests": { + "dep_and_workspace_dep": { + "args": "publish --dry-run --no-check --log-level=debug", + "cwd": "subtract", + "output": "publish-subtract.out" + }, + "bare_specifier": { + "args": "publish --dry-run --no-check --log-level=debug", + "cwd": "subtract-2", + "output": "publish-subtract2.out" + } + } +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/add/index.js b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/add/index.js new file mode 100644 index 000000000..7d658310b --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/add/index.js @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/add/package.json b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/add/package.json new file mode 100644 index 000000000..ecbc84a26 --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/add/package.json @@ -0,0 +1,6 @@ +{ + "name": "add", + "type": "module", + "version": "1.0.0", + "exports": "./index.js" +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/package.json b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/package.json new file mode 100644 index 000000000..0f6d53f87 --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/package.json @@ -0,0 +1,3 @@ +{ + "workspaces": ["./add", "./subtract", "./subtract-2"] +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/publish-subtract.out b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/publish-subtract.out new file mode 100644 index 000000000..89f78c44c --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/publish-subtract.out @@ -0,0 +1,3 @@ +[WILDCARD]Unfurled specifier: add-dep from file:///[WILDLINE]/subtract/index.ts -> npm:add@1.0.0 +[WILDCARD]Unfurled specifier: add from file:///[WILDLINE]/subtract/index.ts -> npm:add@^1.0.0 +[WILDCARD]
\ No newline at end of file diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/publish-subtract2.out b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/publish-subtract2.out new file mode 100644 index 000000000..9edadaf67 --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/publish-subtract2.out @@ -0,0 +1,2 @@ +[WILDCARD]Unfurled specifier: add from file:///[WILDLINE]/subtract-2/index.ts -> npm:add@^1.0.0 +[WILDCARD]
\ No newline at end of file diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/deno.json b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/deno.json new file mode 100644 index 000000000..edae3158b --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@scope/subtract2", + "version": "1.0.0", + "exports": "./index.ts" +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/index.ts b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/index.ts new file mode 100644 index 000000000..aa80c50b5 --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/index.ts @@ -0,0 +1,6 @@ +// test using a bare specifier to a pkg.json dep +import { add } from "add"; + +export function subtract(a: number, b: number): number { + return add(a, -b); +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/package.json b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/package.json new file mode 100644 index 000000000..1cf48f264 --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract-2/package.json @@ -0,0 +1,4 @@ +{ + "name": "subtract2", + "version": "1.0.0" +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/deno.json b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/deno.json new file mode 100644 index 000000000..cb003e374 --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/deno.json @@ -0,0 +1,5 @@ +{ + "name": "@scope/subtract", + "version": "1.0.0", + "exports": "./index.ts" +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/index.ts b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/index.ts new file mode 100644 index 000000000..11f0cf4e8 --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/index.ts @@ -0,0 +1,7 @@ +// test using a pkg.json dep and a workspace dep +import * as addDep from "add-dep"; +import * as addWorkspaceDep from "add"; + +export function subtract(a: number, b: number): number { + return addWorkspaceDep.add(addDep.add(a, -b), 1 - 1); +} diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/package.json b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/package.json new file mode 100644 index 000000000..7d6b0f877 --- /dev/null +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/subtract/package.json @@ -0,0 +1,8 @@ +{ + "name": "subtract", + "version": "1.0.0", + "dependencies": { + "add-dep": "npm:add@1.0.0", + "add": "workspace:^1.0.0" + } +} |