-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
3,778 additions
and
3,026 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"babel-preset-solid", | ||
[ | ||
"@babel/preset-typescript", | ||
{ | ||
"onlyRemoveTypeImports": true | ||
} | ||
] | ||
] | ||
} |
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,33 @@ | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const common_config = { | ||
/* | ||
to support NodeNext module imports | ||
https://stackoverflow.com/questions/73735202/typescript-jest-imports-with-js-extension-cause-error-cannot-find-module | ||
*/ | ||
globals: {"ts-jest": {useESM: true}}, | ||
moduleNameMapper: { | ||
"(.+)\\.js": "$1", | ||
"(.+)\\.jsx": "$1", | ||
}, | ||
extensionsToTreatAsEsm: [".ts", ".tsx"], | ||
} | ||
|
||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const client_config = { | ||
...common_config, | ||
testEnvironment: "jsdom", | ||
preset: "solid-jest/preset/browser", | ||
testMatch: ["<rootDir>/test/**/*.test.(js|ts)?(x)"], | ||
testPathIgnorePatterns: ["/node_modules/", "ssr"], | ||
setupFilesAfterEnv: ["<rootDir>/test/waapi-polyfill.js"], | ||
} | ||
|
||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const server_config = { | ||
...common_config, | ||
preset: "solid-jest/preset/node", | ||
testMatch: ["<rootDir>/test/ssr.test.(js|ts)?(x)"], | ||
} | ||
|
||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
module.exports = process.env["SSR"] ? server_config : client_config |
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
Oops, something went wrong.