diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-12-07 15:59:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-07 15:59:13 -0500 |
commit | 78566753c81a26dc1855d8187c8192ffb1ba64e2 (patch) | |
tree | 73500bbd29baf164312f5bce58d880300a67a52a /cli/tests/integration/run_tests.rs | |
parent | 3f96e5a29a88afafcef0f17458b2800b2db316ee (diff) |
feat: add suggestions to module not found error messages for file urls (#21498)
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 4e0bbdfd2..03de97ee7 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -4740,7 +4740,6 @@ itest!(unsafe_proto_flag { fn test_unstable_sloppy_imports() { let context = TestContextBuilder::new().use_temp_cwd().build(); let temp_dir = context.temp_dir(); - temp_dir.write("deno.json", r#"{ "unstable": ["sloppy-imports"] }"#); temp_dir.write("a.ts", "export class A {}"); temp_dir.write("b.js", "export class B {}"); temp_dir.write("c.mts", "export class C {}"); @@ -4771,6 +4770,18 @@ console.log(g.G); "#, ); + // run without sloppy imports + context + .new_command() + .args("run main.ts") + .run() + .assert_matches_text(r#"error: Module not found "file:///[WILDCARD]/a.js". Maybe change the extension to '.ts' or run with --unstable-sloppy-imports + at file:///[WILDCARD]/main.ts:1:20 +"#) + .assert_exit_code(1); + + // now run with sloppy imports + temp_dir.write("deno.json", r#"{ "unstable": ["sloppy-imports"] }"#); context .new_command() .args("run main.ts") |