Skip to content

Commit

Permalink
Add unit test for complex resolve errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic authored and arlyon committed Oct 16, 2024
1 parent 92e95d4 commit b03c7ed
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
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));
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
|

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b03c7ed

Please sign in to comment.