-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade
vitest-environment-miniflare
for recent Vitest versions
- Mark `vitest-environment-miniflare` as `"type": "module"` - Use Vitest's own `createChainable()` - Delay importing `vitest` until needed Closes #645 Closes #661
- Loading branch information
Showing
8 changed files
with
1,728 additions
and
318 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,14 @@ | ||
diff --git a/node_modules/@ava/typescript/index.js b/node_modules/@ava/typescript/index.js | ||
index 8fc5369..f71c919 100644 | ||
--- a/node_modules/@ava/typescript/index.js | ||
+++ b/node_modules/@ava/typescript/index.js | ||
@@ -167,7 +167,8 @@ module.exports = ({negotiateProtocol}) => { | ||
|
||
const [from, to] = rewritePaths.find(([from]) => ref.startsWith(from)); | ||
// TODO: Support JSX preserve mode — https://www.typescriptlang.org/docs/handbook/jsx.html | ||
- const rewritten = `${to}${ref.slice(from.length)}`.replace(testFileExtension, '.js'); | ||
+ const jsExtension = from.includes("vitest-environment-miniflare") ? ".cjs" : ".js"; | ||
+ const rewritten = `${to}${ref.slice(from.length)}`.replace(testFileExtension, jsExtension); | ||
return requireFn(rewritten); | ||
} | ||
}; |
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