-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for complex resolve errors
- Loading branch information
Showing
6 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
turbopack/crates/turbopack-tests/tests/snapshot/imports/resolve_error_complex/input/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
let specifier = "does-not-exist/path"; | ||
if (x) { | ||
specifier = "does-not-exist-either/path" | ||
} | ||
if (y) { | ||
specifier = y; | ||
} | ||
|
||
console.log(require(specifier)); |
18 changes: 18 additions & 0 deletions
18
...esolve_error_complex/issues/__l___Module not found____c__ Can't resolve __c_('-70fca4.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error - [resolve] [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/resolve_error_complex/input/index.js /turbopack/crates/turbopack-tests/tests/snapshot/imports/resolve_error_complex/input/index.js:9:12 Module not found: Can't resolve ('does-not-exist/path' | 'does-not-exist-either/path' | <dynamic>) | ||
|
||
5 | if (y) { | ||
6 | specifier = y; | ||
7 | } | ||
8 | | ||
+ v----------------v | ||
9 + console.log(require(specifier)); | ||
+ ^----------------^ | ||
10 | | ||
|
||
|
||
|
||
| It was not possible to find the requested file. | ||
| Parsed request as written in source code: module "does-not-exist" with subpath '/path' or module "does-not-exist-either" with subpath '/path' or dynamic | ||
| Path where resolving has started: [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/resolve_error_complex/input/index.js | ||
| Type of request: commonjs request | ||
| |
6 changes: 6 additions & 0 deletions
6
.../b1abf_turbopack-tests_tests_snapshot_imports_resolve_error_complex_input_index_a0451a.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...bf_turbopack-tests_tests_snapshot_imports_resolve_error_complex_input_index_a0451a.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
.../b1abf_turbopack-tests_tests_snapshot_imports_resolve_error_complex_input_index_bc8bed.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...bf_turbopack-tests_tests_snapshot_imports_resolve_error_complex_input_index_bc8bed.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.