Skip to content

Commit

Permalink
add spec test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hajime-san committed Nov 10, 2024
1 parent 81962e8 commit 970e5ee
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@denotest/cjs-non-explicit-file",
"version": "1.0.0",
"main": "index.js"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("./server.node");
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports["server"] = function () {
return 1;
};
15 changes: 15 additions & 0 deletions tests/specs/npm/sub_paths_cjs_import_faillure/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"steps": [{
"args": "run --quiet sub_paths_cjs_import_faillure/main1.js",
"output": "sub_paths_cjs_import_faillure/main1.out",
"exitCode": 1
}, {
"args": "run --quiet sub_paths_cjs_import_faillure/main2.js",
"output": "sub_paths_cjs_import_faillure/main2.out",
"exitCode": 1
}, {
"args": "run --quiet sub_paths_cjs_import_faillure/main3.js",
"output": "sub_paths_cjs_import_faillure/main3.out",
"exitCode": 1
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Server from "npm:@denotest/[email protected]/server";
console.log(Server);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Unable to load [WILDCARD]server imported from [WILDCARD]main1.js
Did you mean to import "npm:@denotest/[email protected]/server.js"?

Caused by:
[WILDCARD]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Server from "npm:@denotest/[email protected]/server.node";
console.log(Server);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Unable to load [WILDCARD]server.node imported from [WILDCARD]main2.js
Did you mean to import "npm:@denotest/[email protected]/server.node.js"?

Caused by:
[WILDCARD]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// deno-fmt-ignore
const Server = await import("npm:@denotest/[email protected]/server");
console.log(Server);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
error: Uncaught (in promise) TypeError: Unable to load [WILDCARD]server imported from [WILDCARD]main3.js
Did you mean to import "npm:@denotest/[email protected]/server.js"?
Caused by:
[WILDCARD]
const Server = await import("npm:@denotest/[email protected]/server");
^
at async [WILDCARD]main3.js:[WILDCARD]

0 comments on commit 970e5ee

Please sign in to comment.