-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deno): allow direct CommonJS execution in Deno (#300)
This feature allows you to run tests that use `require`, `module.exports`, and `module` directly in Deno, without the need for transpilation or workarounds. This is especially useful for testing Node.js and Bun projects on Deno.
- Loading branch information
1 parent
5015ef3
commit fa358b5
Showing
29 changed files
with
794 additions
and
207 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
website/** linguist-documentation | ||
test/docker/** linguist-vendored | ||
fixtures/** linguist-vendored | ||
src/bin/** linguist-language=TypeScript |
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
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
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,2 @@ | ||
const message = 'Hello from exports'; | ||
exports.message = message; |
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,2 @@ | ||
const message = 'Hello from module.exports'; | ||
module.exports = message; |
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,7 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const asModule = require('./module.cjs'); | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { message: asExports } = require('./exports.cjs'); | ||
|
||
console.log(asModule); | ||
console.log(asExports); |
Oops, something went wrong.