Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(workspace): provide workspace members as 'imports' in import map #23492

Merged
merged 4 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rewrite tests as specs
  • Loading branch information
bartlomieju committed Apr 22, 2024
commit 7fab5f28701d507f02bac0d5013f0f2e30a296d2
38 changes: 0 additions & 38 deletions tests/integration/run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4918,44 4918,6 @@ itest!(explicit_resource_management {
output: "run/explicit_resource_management/main.out",
});

itest!(workspaces_basic {
args: "run -L debug -A main.ts",
output: "run/workspaces/basic/main.out",
cwd: Some("run/workspaces/basic/"),
copy_temp_dir: Some("run/workspaces/basic/"),
envs: env_vars_for_npm_tests(),
http_server: true,
});

itest!(workspaces_member_outside_root_dir {
args: "run -A main.ts",
output: "run/workspaces/member_outside_root_dir/main.out",
cwd: Some("run/workspaces/member_outside_root_dir/"),
copy_temp_dir: Some("run/workspaces/member_outside_root_dir/"),
envs: env_vars_for_npm_tests(),
http_server: true,
exit_code: 1,
});

itest!(workspaces_nested_member {
args: "run -A main.ts",
output: "run/workspaces/nested_member/main.out",
cwd: Some("run/workspaces/nested_member/"),
copy_temp_dir: Some("run/workspaces/nested_member/"),
envs: env_vars_for_npm_tests(),
http_server: true,
exit_code: 1,
});

itest!(workspaces_members_are_imports {
args: "run -A main.ts",
output: "run/workspaces/members_are_imports/main.out",
cwd: Some("run/workspaces/members_are_imports/"),
copy_temp_dir: Some("run/workspaces/members_are_imports/"),
envs: env_vars_for_npm_tests(),
http_server: true,
});

itest!(unsafe_proto {
args: "run -A run/unsafe_proto/main.js",
output: "run/unsafe_proto/main.out",
Expand Down
5 changes: 5 additions & 0 deletions tests/specs/run/workspaces/basic/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 1,5 @@
{
"args": "run -L debug -A main.ts",
"output": "main.out",
"tempDir": true
}
Original file line number Diff line number Diff line change
@@ -1,7 1,11 @@
[WILDCARD]Workspace config generated this import map {
"imports": {
"chalk": "npm:chalk",
"chalk/": "npm:/chalk/"
"chalk/": "npm:/chalk/",
"qwerqwer": "jsr:qwerqwer@^0.0.0",
"qwerqwer/": "jsr:/qwerqwer@^0.0.0/",
"asdfasdfasdf": "jsr:asdfasdfasdf@^0.0.0",
"asdfasdfasdf/": "jsr:/asdfasdfasdf@^0.0.0/"
},
"scopes": {
"./foo/": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
{
"args": "run -A main.ts",
"output": "main.out",
"tempDir": true,
"exitCode": 1
}
5 changes: 5 additions & 0 deletions tests/specs/run/workspaces/members_are_imports/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 1,5 @@
{
"args": "run -A main.ts",
"output": "main.out",
"tempDir": true
}
6 changes: 6 additions & 0 deletions tests/specs/run/workspaces/nested_member/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
{
"args": "run -A main.ts",
"output": "main.out",
"tempDir": true,
"exitCode": 1
}
2 changes: 1 addition & 1 deletion tools/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 213,7 @@ async function ensureNoNewITests() {
"pm_tests.rs": 0,
"publish_tests.rs": 28,
"repl_tests.rs": 0,
"run_tests.rs": 382,
"run_tests.rs": 379,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

"shared_library_tests.rs": 0,
"task_tests.rs": 30,
"test_tests.rs": 80,
Expand Down
Loading