-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Jest configuration to match Docusaurus standards
- Loading branch information
1 parent
2bf30e0
commit 464a713
Showing
1 changed file
with
39 additions
and
0 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,39 @@ | ||
import {fileURLToPath} from 'url'; | ||
|
||
const config = { | ||
rootDir: fileURLToPath(new URL('.', import.meta.url)), | ||
verbose: true, | ||
testURL: 'http://localhost/', | ||
testEnvironment: 'jsdom', | ||
setupFilesAfterEnv: ['./jest.setup.ts'], | ||
testPathIgnorePatterns: [ | ||
'/node_modules/', | ||
'__fixtures__', | ||
'build', | ||
'.docusaurus', | ||
], | ||
transform: { | ||
'^.+\\.[jt]sx?$': [ | ||
'@swc/jest', | ||
{ | ||
jsc: { | ||
target: 'es2020', | ||
}, | ||
}, | ||
], | ||
}, | ||
moduleNameMapper: { | ||
'^@theme/(.*)$': '@docusaurus/theme-classic/lib/theme/$1', | ||
'^@docusaurus/(.*)$': '@docusaurus/$1', | ||
'^@site/(.*)$': '<rootDir>/$1', | ||
}, | ||
transformIgnorePatterns: ['/node_modules/(?!(eta|@docusaurus)/)'], | ||
fakeTimers: { | ||
enableGlobally: true, | ||
}, | ||
snapshotSerializers: [require.resolve('snapshot-serializer-beautifier')], | ||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], | ||
coveragePathIgnorePatterns: ['/node_modules/', '__tests__'], | ||
}; | ||
|
||
export default config; |