summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/jsr_tests.rs8
-rw-r--r--cli/tests/integration/publish_tests.rs64
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/0.1.0/mod.ts17
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/0.1.0_meta.json5
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/meta.json5
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0/mod.ts12
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0_meta.json5
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/meta.json5
-rw-r--r--cli/tests/testdata/jsr/subset_type_graph/main.check.out45
-rw-r--r--cli/tests/testdata/jsr/subset_type_graph/main.ts13
-rw-r--r--cli/tests/testdata/publish/invalid_fast_check.out8
-rw-r--r--cli/tests/testdata/publish/invalid_fast_check/deno.json7
-rw-r--r--cli/tests/testdata/publish/invalid_fast_check/mod.ts4
-rw-r--r--cli/tests/testdata/publish/javascript_decl_file.out6
-rw-r--r--cli/tests/testdata/publish/javascript_decl_file/deno.json7
-rw-r--r--cli/tests/testdata/publish/javascript_decl_file/mod.d.ts1
-rw-r--r--cli/tests/testdata/publish/javascript_decl_file/mod.js5
-rw-r--r--cli/tests/testdata/publish/javascript_missing_decl_file.out6
-rw-r--r--cli/tests/testdata/publish/javascript_missing_decl_file/deno.json8
-rw-r--r--cli/tests/testdata/publish/javascript_missing_decl_file/mod.js3
-rw-r--r--cli/tests/testdata/publish/javascript_missing_decl_file/other.js3
-rw-r--r--cli/tests/testdata/publish/missing_deno_json/main.ts3
-rw-r--r--cli/tests/testdata/publish/successful.out3
-rw-r--r--cli/tests/testdata/publish/successful/deno.json2
-rw-r--r--cli/tests/testdata/publish/successful/mod.ts2
-rw-r--r--cli/tests/testdata/publish/successful/std_http.ts6
-rw-r--r--cli/tests/testdata/publish/workspace.out11
-rw-r--r--cli/tests/testdata/publish/workspace/bar/deno.json7
-rw-r--r--cli/tests/testdata/publish/workspace/bar/mod.ts3
-rw-r--r--cli/tests/testdata/publish/workspace/deno.json6
-rw-r--r--cli/tests/testdata/publish/workspace/foo/deno.json10
-rw-r--r--cli/tests/testdata/publish/workspace/foo/mod.ts5
-rw-r--r--cli/tests/testdata/publish/workspace_individual.out6
33 files changed, 294 insertions, 7 deletions
diff --git a/cli/tests/integration/jsr_tests.rs b/cli/tests/integration/jsr_tests.rs
index ed34ead96..f7bdb6032 100644
--- a/cli/tests/integration/jsr_tests.rs
+++ b/cli/tests/integration/jsr_tests.rs
@@ -54,6 +54,14 @@ itest!(deps_info {
http_server: true,
});
+itest!(subset_type_graph {
+ args: "check --all jsr/subset_type_graph/main.ts",
+ output: "jsr/subset_type_graph/main.check.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+ exit_code: 1,
+});
+
itest!(version_not_found {
args: "run jsr/version_not_found/main.ts",
output: "jsr/version_not_found/main.out",
diff --git a/cli/tests/integration/publish_tests.rs b/cli/tests/integration/publish_tests.rs
index 912955782..c0569e506 100644
--- a/cli/tests/integration/publish_tests.rs
+++ b/cli/tests/integration/publish_tests.rs
@@ -15,21 +15,75 @@ pub fn env_vars_for_registry() -> Vec<(String, String)> {
}
itest!(no_token {
- args: "publish publish/missing_deno_json",
+ args: "publish",
+ cwd: Some("publish/missing_deno_json"),
output: "publish/no_token.out",
exit_code: 1,
});
itest!(missing_deno_json {
- args: "publish --token 'sadfasdf' $TESTDATA/publish/missing_deno_json",
+ args: "publish --token 'sadfasdf'",
output: "publish/missing_deno_json.out",
+ cwd: Some("publish/missing_deno_json"),
+ copy_temp_dir: Some("publish/missing_deno_json"),
exit_code: 1,
temp_cwd: true,
});
+itest!(invalid_fast_check {
+ args: "publish --token 'sadfasdf'",
+ output: "publish/invalid_fast_check.out",
+ cwd: Some("publish/invalid_fast_check"),
+ copy_temp_dir: Some("publish/invalid_fast_check"),
+ exit_code: 1,
+ temp_cwd: true,
+});
+
+itest!(javascript_missing_decl_file {
+ args: "publish --token 'sadfasdf'",
+ output: "publish/javascript_missing_decl_file.out",
+ cwd: Some("publish/javascript_missing_decl_file"),
+ copy_temp_dir: Some("publish/javascript_missing_decl_file"),
+ envs: env_vars_for_registry(),
+ exit_code: 0,
+ temp_cwd: true,
+});
+
+itest!(javascript_decl_file {
+ args: "publish --token 'sadfasdf'",
+ output: "publish/javascript_decl_file.out",
+ cwd: Some("publish/javascript_decl_file"),
+ copy_temp_dir: Some("publish/javascript_decl_file"),
+ envs: env_vars_for_registry(),
+ exit_code: 0,
+ temp_cwd: true,
+});
+
itest!(successful {
- args: "publish --token 'sadfasdf' $TESTDATA/publish/successful",
+ args: "publish --token 'sadfasdf'",
output: "publish/successful.out",
+ cwd: Some("publish/successful"),
+ copy_temp_dir: Some("publish/successful"),
+ envs: env_vars_for_registry(),
+ http_server: true,
+ temp_cwd: true,
+});
+
+itest!(workspace_all {
+ args: "publish --unstable-workspaces --token 'sadfasdf'",
+ output: "publish/workspace.out",
+ cwd: Some("publish/workspace"),
+ copy_temp_dir: Some("publish/workspace"),
+ envs: env_vars_for_registry(),
+ http_server: true,
+ temp_cwd: true,
+});
+
+itest!(workspace_individual {
+ args: "publish --unstable-workspaces --token 'sadfasdf'",
+ output: "publish/workspace_individual.out",
+ cwd: Some("publish/workspace/bar"),
+ copy_temp_dir: Some("publish/workspace"),
envs: env_vars_for_registry(),
http_server: true,
temp_cwd: true,
@@ -43,7 +97,7 @@ fn ignores_directories() {
"name": "@foo/bar",
"version": "1.0.0",
"exclude": [ "ignore" ],
- "exports": "main_included.ts"
+ "exports": "./main_included.ts"
}));
let ignored_dirs = vec![
@@ -68,7 +122,6 @@ fn ignores_directories() {
.arg("--log-level=debug")
.arg("--token")
.arg("sadfasdf")
- .arg(temp_dir)
.run();
output.assert_exit_code(0);
let output = output.combined_output();
@@ -81,4 +134,5 @@ fn publish_context_builder() -> TestContextBuilder {
TestContextBuilder::new()
.use_http_server()
.envs(env_vars_for_registry())
+ .use_temp_cwd()
}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/0.1.0/mod.ts b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/0.1.0/mod.ts
new file mode 100644
index 000000000..e81b2309a
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/0.1.0/mod.ts
@@ -0,0 +1,17 @@
+// add some statements that will be removed by the subset
+// type graph so that we can test that the source map works
+console.log(1);
+console.log(2);
+console.log(3);
+
+export class Foo {
+ method(): number {
+ return Math.random();
+ }
+}
+
+// this won't be type checked against because the subset
+// type graph omit this code because it's not part of the
+// public API.
+const invalidTypeCheck: number = "";
+console.log(invalidTypeCheck);
diff --git a/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/0.1.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/0.1.0_meta.json
new file mode 100644
index 000000000..631a18d0e
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/0.1.0_meta.json
@@ -0,0 +1,5 @@
+{
+ "exports": {
+ ".": "./mod.ts"
+ }
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/meta.json b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/meta.json
new file mode 100644
index 000000000..d10aa5c3a
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph/meta.json
@@ -0,0 +1,5 @@
+{
+ "versions": {
+ "0.1.0": {}
+ }
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0/mod.ts b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0/mod.ts
new file mode 100644
index 000000000..6a5036bf5
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0/mod.ts
@@ -0,0 +1,12 @@
+export class Foo {
+ method() {
+ return Math.random();
+ }
+}
+
+// This will be analyzed because the method above is missing an
+// explicit type which is required for the subset type graph to take
+// effect. So the entire source file will be type checked against,
+// causing a type error here.
+const invalidTypeCheck: number = "";
+console.log(invalidTypeCheck);
diff --git a/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0_meta.json
new file mode 100644
index 000000000..631a18d0e
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0_meta.json
@@ -0,0 +1,5 @@
+{
+ "exports": {
+ ".": "./mod.ts"
+ }
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/meta.json b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/meta.json
new file mode 100644
index 000000000..d10aa5c3a
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/subset_type_graph_invalid/meta.json
@@ -0,0 +1,5 @@
+{
+ "versions": {
+ "0.1.0": {}
+ }
+}
diff --git a/cli/tests/testdata/jsr/subset_type_graph/main.check.out b/cli/tests/testdata/jsr/subset_type_graph/main.check.out
new file mode 100644
index 000000000..fc4539c8a
--- /dev/null
+++ b/cli/tests/testdata/jsr/subset_type_graph/main.check.out
@@ -0,0 +1,45 @@
+Download http://localhost:4545/jsr/registry/@denotest/subset_type_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/subset_type_graph_invalid/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/subset_type_graph/0.1.0_meta.json
+Download http://localhost:4545/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0_meta.json
+[UNORDERED_START]
+Download http://localhost:4545/jsr/registry/@denotest/subset_type_graph/0.1.0/mod.ts
+Download http://localhost:4545/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0/mod.ts
+[UNORDERED_END]
+Check file:///[WILDCARD]/subset_type_graph/main.ts
+error: TS2322 [ERROR]: Type 'string' is not assignable to type 'number'.
+const invalidTypeCheck: number = "";
+ ~~~~~~~~~~~~~~~~
+ at http://localhost:4545/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0/mod.ts:11:7
+
+TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
+const error1: string = new Foo1().method();
+ ~~~~~~
+ at file:///[WILDCARD]/subset_type_graph/main.ts:5:7
+
+TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
+const error2: string = new Foo2().method();
+ ~~~~~~
+ at file:///[WILDCARD]/subset_type_graph/main.ts:6:7
+
+TS2551 [ERROR]: Property 'method2' does not exist on type 'Foo'. Did you mean 'method'?
+new Foo1().method2();
+ ~~~~~~~
+ at file:///[WILDCARD]/subset_type_graph/main.ts:12:12
+
+ 'method' is declared here.
+ method(): number {
+ ~~~~~~
+ at http://localhost:4545/jsr/registry/@denotest/subset_type_graph/0.1.0/mod.ts:8:3
+
+TS2551 [ERROR]: Property 'method2' does not exist on type 'Foo'. Did you mean 'method'?
+new Foo2().method2();
+ ~~~~~~~
+ at file:///[WILDCARD]/subset_type_graph/main.ts:13:12
+
+ 'method' is declared here.
+ method() {
+ ~~~~~~
+ at http://localhost:4545/jsr/registry/@denotest/subset_type_graph_invalid/0.1.0/mod.ts:2:3
+
+Found 5 errors.
diff --git a/cli/tests/testdata/jsr/subset_type_graph/main.ts b/cli/tests/testdata/jsr/subset_type_graph/main.ts
new file mode 100644
index 000000000..2e1614be9
--- /dev/null
+++ b/cli/tests/testdata/jsr/subset_type_graph/main.ts
@@ -0,0 +1,13 @@
+import { Foo as Foo1 } from "jsr:@denotest/subset_type_graph@0.1.0";
+import { Foo as Foo2 } from "jsr:@denotest/subset_type_graph_invalid@0.1.0";
+
+// these will both raise type checking errors
+const error1: string = new Foo1().method();
+const error2: string = new Foo2().method();
+console.log(error1);
+console.log(error2);
+
+// now raise some errors that will show the original code and
+// these should source map to the original
+new Foo1().method2();
+new Foo2().method2();
diff --git a/cli/tests/testdata/publish/invalid_fast_check.out b/cli/tests/testdata/publish/invalid_fast_check.out
new file mode 100644
index 000000000..ed731c1d1
--- /dev/null
+++ b/cli/tests/testdata/publish/invalid_fast_check.out
@@ -0,0 +1,8 @@
+Checking fast check type graph for errors...
+
+Missing explicit return type in the public API.
+ at file:///[WILDCARD]/publish/invalid_fast_check/mod.ts:2:17
+
+Fixing these fast check errors is required to make the code fast check compatible which enables type checking your package's TypeScript code with the same performance as if you had distributed declaration files. Do any of these errors seem too restrictive or incorrect? Please open an issue if so to help us improve: https://github.com/denoland/deno/issues
+
+error: Had 1 fast check error.
diff --git a/cli/tests/testdata/publish/invalid_fast_check/deno.json b/cli/tests/testdata/publish/invalid_fast_check/deno.json
new file mode 100644
index 000000000..5826e5529
--- /dev/null
+++ b/cli/tests/testdata/publish/invalid_fast_check/deno.json
@@ -0,0 +1,7 @@
+{
+ "name": "@foo/bar",
+ "version": "1.1.0",
+ "exports": {
+ ".": "./mod.ts"
+ }
+}
diff --git a/cli/tests/testdata/publish/invalid_fast_check/mod.ts b/cli/tests/testdata/publish/invalid_fast_check/mod.ts
new file mode 100644
index 000000000..025311049
--- /dev/null
+++ b/cli/tests/testdata/publish/invalid_fast_check/mod.ts
@@ -0,0 +1,4 @@
+// requires an explicit type annotation of `number`
+export function getRandom() {
+ return Math.random();
+}
diff --git a/cli/tests/testdata/publish/javascript_decl_file.out b/cli/tests/testdata/publish/javascript_decl_file.out
new file mode 100644
index 000000000..deb66eba0
--- /dev/null
+++ b/cli/tests/testdata/publish/javascript_decl_file.out
@@ -0,0 +1,6 @@
+Checking fast check type graph for errors...
+Ensuring type checks...
+Check file:///[WILDCARD]/javascript_decl_file/mod.js
+Publishing @foo/bar@1.0.0 ...
+Successfully published @foo/bar@1.0.0
+Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details
diff --git a/cli/tests/testdata/publish/javascript_decl_file/deno.json b/cli/tests/testdata/publish/javascript_decl_file/deno.json
new file mode 100644
index 000000000..e5dbfa8d3
--- /dev/null
+++ b/cli/tests/testdata/publish/javascript_decl_file/deno.json
@@ -0,0 +1,7 @@
+{
+ "name": "@foo/bar",
+ "version": "1.0.0",
+ "exports": {
+ ".": "./mod.js"
+ }
+}
diff --git a/cli/tests/testdata/publish/javascript_decl_file/mod.d.ts b/cli/tests/testdata/publish/javascript_decl_file/mod.d.ts
new file mode 100644
index 000000000..b2f6c69a8
--- /dev/null
+++ b/cli/tests/testdata/publish/javascript_decl_file/mod.d.ts
@@ -0,0 +1 @@
+export function getRandom(): number;
diff --git a/cli/tests/testdata/publish/javascript_decl_file/mod.js b/cli/tests/testdata/publish/javascript_decl_file/mod.js
new file mode 100644
index 000000000..2395e622b
--- /dev/null
+++ b/cli/tests/testdata/publish/javascript_decl_file/mod.js
@@ -0,0 +1,5 @@
+/// <reference types="./mod.d.ts" />
+
+export function getRandom() {
+ return Math.random();
+}
diff --git a/cli/tests/testdata/publish/javascript_missing_decl_file.out b/cli/tests/testdata/publish/javascript_missing_decl_file.out
new file mode 100644
index 000000000..02478a5b5
--- /dev/null
+++ b/cli/tests/testdata/publish/javascript_missing_decl_file.out
@@ -0,0 +1,6 @@
+Checking fast check type graph for errors...
+Warning Package '@foo/bar' is a JavaScript package without a corresponding declaration file. This may lead to a non-optimal experience for users of your package. For performance reasons, it's recommended to ship a corresponding TypeScript declaration file or to convert to TypeScript.
+Ensuring type checks...
+Publishing @foo/bar@1.0.0 ...
+Successfully published @foo/bar@1.0.0
+Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details
diff --git a/cli/tests/testdata/publish/javascript_missing_decl_file/deno.json b/cli/tests/testdata/publish/javascript_missing_decl_file/deno.json
new file mode 100644
index 000000000..e12927c26
--- /dev/null
+++ b/cli/tests/testdata/publish/javascript_missing_decl_file/deno.json
@@ -0,0 +1,8 @@
+{
+ "name": "@foo/bar",
+ "version": "1.0.0",
+ "exports": {
+ ".": "./mod.js",
+ "./other": "./other.js"
+ }
+}
diff --git a/cli/tests/testdata/publish/javascript_missing_decl_file/mod.js b/cli/tests/testdata/publish/javascript_missing_decl_file/mod.js
new file mode 100644
index 000000000..4a62fa5b4
--- /dev/null
+++ b/cli/tests/testdata/publish/javascript_missing_decl_file/mod.js
@@ -0,0 +1,3 @@
+export function getRandom() {
+ return Math.random();
+}
diff --git a/cli/tests/testdata/publish/javascript_missing_decl_file/other.js b/cli/tests/testdata/publish/javascript_missing_decl_file/other.js
new file mode 100644
index 000000000..89ffb80ba
--- /dev/null
+++ b/cli/tests/testdata/publish/javascript_missing_decl_file/other.js
@@ -0,0 +1,3 @@
+export function other() {
+ return Math.random();
+}
diff --git a/cli/tests/testdata/publish/missing_deno_json/main.ts b/cli/tests/testdata/publish/missing_deno_json/main.ts
new file mode 100644
index 000000000..8d9b8a22a
--- /dev/null
+++ b/cli/tests/testdata/publish/missing_deno_json/main.ts
@@ -0,0 +1,3 @@
+export function add(a: number, b: number): number {
+ return a + b;
+}
diff --git a/cli/tests/testdata/publish/successful.out b/cli/tests/testdata/publish/successful.out
index a6a6a9bd4..7dbe16807 100644
--- a/cli/tests/testdata/publish/successful.out
+++ b/cli/tests/testdata/publish/successful.out
@@ -1,3 +1,6 @@
+Checking fast check type graph for errors...
+Ensuring type checks...
+Check file:///[WILDCARD]/publish/successful/mod.ts
Publishing @foo/bar@1.0.0 ...
Successfully published @foo/bar@1.0.0
Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details
diff --git a/cli/tests/testdata/publish/successful/deno.json b/cli/tests/testdata/publish/successful/deno.json
index 930f3aa08..fefab899b 100644
--- a/cli/tests/testdata/publish/successful/deno.json
+++ b/cli/tests/testdata/publish/successful/deno.json
@@ -5,6 +5,6 @@
".": "./mod.ts"
},
"imports": {
- "@std/http": "jsr:@std/http@1"
+ "@std/http": "./std_http.ts"
}
}
diff --git a/cli/tests/testdata/publish/successful/mod.ts b/cli/tests/testdata/publish/successful/mod.ts
index 152bce40b..4bb6da255 100644
--- a/cli/tests/testdata/publish/successful/mod.ts
+++ b/cli/tests/testdata/publish/successful/mod.ts
@@ -1,5 +1,5 @@
import http from "@std/http";
-export function foobar() {
+export function foobar(): { fileServer(): void } {
return http.fileServer;
}
diff --git a/cli/tests/testdata/publish/successful/std_http.ts b/cli/tests/testdata/publish/successful/std_http.ts
new file mode 100644
index 000000000..9d57b36f3
--- /dev/null
+++ b/cli/tests/testdata/publish/successful/std_http.ts
@@ -0,0 +1,6 @@
+// temp until we get jsr:@std/http in the test server
+export default {
+ fileServer() {
+ console.log("Hi");
+ },
+};
diff --git a/cli/tests/testdata/publish/workspace.out b/cli/tests/testdata/publish/workspace.out
new file mode 100644
index 000000000..588c22bbc
--- /dev/null
+++ b/cli/tests/testdata/publish/workspace.out
@@ -0,0 +1,11 @@
+Publishing a workspace...
+Checking fast check type graph for errors...
+Ensuring type checks...
+Check file:///[WILDCARD]/workspace/foo/mod.ts
+Check file:///[WILDCARD]/workspace/bar/mod.ts
+Publishing @foo/bar@1.0.0 ...
+Successfully published @foo/bar@1.0.0
+Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details
+Publishing @foo/foo@1.0.0 ...
+Successfully published @foo/foo@1.0.0
+Visit http://127.0.0.1:4250/@foo/foo@1.0.0 for details
diff --git a/cli/tests/testdata/publish/workspace/bar/deno.json b/cli/tests/testdata/publish/workspace/bar/deno.json
new file mode 100644
index 000000000..213a7cec6
--- /dev/null
+++ b/cli/tests/testdata/publish/workspace/bar/deno.json
@@ -0,0 +1,7 @@
+{
+ "name": "@foo/bar",
+ "version": "1.0.0",
+ "exports": {
+ ".": "./mod.ts"
+ }
+}
diff --git a/cli/tests/testdata/publish/workspace/bar/mod.ts b/cli/tests/testdata/publish/workspace/bar/mod.ts
new file mode 100644
index 000000000..8d9b8a22a
--- /dev/null
+++ b/cli/tests/testdata/publish/workspace/bar/mod.ts
@@ -0,0 +1,3 @@
+export function add(a: number, b: number): number {
+ return a + b;
+}
diff --git a/cli/tests/testdata/publish/workspace/deno.json b/cli/tests/testdata/publish/workspace/deno.json
new file mode 100644
index 000000000..57602aab5
--- /dev/null
+++ b/cli/tests/testdata/publish/workspace/deno.json
@@ -0,0 +1,6 @@
+{
+ "workspaces": [
+ "foo",
+ "bar"
+ ]
+}
diff --git a/cli/tests/testdata/publish/workspace/foo/deno.json b/cli/tests/testdata/publish/workspace/foo/deno.json
new file mode 100644
index 000000000..79563d36c
--- /dev/null
+++ b/cli/tests/testdata/publish/workspace/foo/deno.json
@@ -0,0 +1,10 @@
+{
+ "name": "@foo/foo",
+ "version": "1.0.0",
+ "exports": {
+ ".": "./mod.ts"
+ },
+ "imports": {
+ "bar": "jsr:@foo/bar@1"
+ }
+}
diff --git a/cli/tests/testdata/publish/workspace/foo/mod.ts b/cli/tests/testdata/publish/workspace/foo/mod.ts
new file mode 100644
index 000000000..adf584463
--- /dev/null
+++ b/cli/tests/testdata/publish/workspace/foo/mod.ts
@@ -0,0 +1,5 @@
+import * as bar from "bar";
+
+export function add(a: number, b: number): number {
+ return bar.add(a, b);
+}
diff --git a/cli/tests/testdata/publish/workspace_individual.out b/cli/tests/testdata/publish/workspace_individual.out
new file mode 100644
index 000000000..4eadb45af
--- /dev/null
+++ b/cli/tests/testdata/publish/workspace_individual.out
@@ -0,0 +1,6 @@
+Checking fast check type graph for errors...
+Ensuring type checks...
+Check file:///[WILDCARD]/workspace/bar/mod.ts
+Publishing @foo/bar@1.0.0 ...
+Successfully published @foo/bar@1.0.0
+Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details