summaryrefslogtreecommitdiff
path: root/tests/specs/run/patch/my-pkg
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-20 10:11:43 -0400
committerGitHub <noreply@github.com>2024-08-20 14:11:43 +0000
commitf1c58ec041a05276d9f33562a5843c0bb7fb95b3 (patch)
treedc4bca4eab617e75474e19a7491ed88d5ee64fef /tests/specs/run/patch/my-pkg
parent19bcb40059f6ba730b6d05d8edf005c6b40f6ff8 (diff)
feat(unstable): ability to use a local copy of jsr packages (#25068)
Diffstat (limited to 'tests/specs/run/patch/my-pkg')
-rw-r--r--tests/specs/run/patch/my-pkg/deno.json11
-rw-r--r--tests/specs/run/patch/my-pkg/mod.test.ts7
-rw-r--r--tests/specs/run/patch/my-pkg/mod.ts2
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/specs/run/patch/my-pkg/deno.json b/tests/specs/run/patch/my-pkg/deno.json
new file mode 100644
index 000000000..0303c9974
--- /dev/null
+++ b/tests/specs/run/patch/my-pkg/deno.json
@@ -0,0 +1,11 @@
+{
+ "name": "@scope/my-pkg",
+ "version": "1.0.0",
+ "exports": "./mod.ts",
+ "imports": {
+ "@denotest/add": "jsr:@denotest/add@1"
+ },
+ "patch": [
+ "../add"
+ ]
+}
diff --git a/tests/specs/run/patch/my-pkg/mod.test.ts b/tests/specs/run/patch/my-pkg/mod.test.ts
new file mode 100644
index 000000000..1c694298c
--- /dev/null
+++ b/tests/specs/run/patch/my-pkg/mod.test.ts
@@ -0,0 +1,7 @@
+import { add } from "./mod.ts";
+
+Deno.test("add", () => {
+ if (add(1, 2) !== 3) {
+ throw new Error("fail");
+ }
+});
diff --git a/tests/specs/run/patch/my-pkg/mod.ts b/tests/specs/run/patch/my-pkg/mod.ts
new file mode 100644
index 000000000..41389ed65
--- /dev/null
+++ b/tests/specs/run/patch/my-pkg/mod.ts
@@ -0,0 +1,2 @@
+export { add } from "@denotest/add";
+import "@denotest/add"; // ensure it only warns once