-
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.
Install & configure Jest, testing libs, etc.
- Loading branch information
Bennett Dams
committed
Oct 20, 2021
1 parent
78b657e
commit aaf1fb3
Showing
4 changed files
with
5,983 additions
and
1,742 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
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,30 @@ | ||
module.exports = { | ||
collectCoverageFrom: [ | ||
'**/*.{js,jsx,ts,tsx}', | ||
'!**/*.d.ts', | ||
'!**/node_modules/**', | ||
], | ||
moduleNameMapper: { | ||
/* Handle CSS imports (with CSS modules) | ||
https://jestjs.io/docs/webpack#mocking-css-modules */ | ||
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy', | ||
|
||
// Handle CSS imports (without CSS modules) | ||
'^.+\\.(css|sass|scss)$': '<rootDir>/__mocks__/styleMock.js', | ||
|
||
/* Handle image imports | ||
https://jestjs.io/docs/webpack#handling-static-assets */ | ||
'^.+\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>/__mocks__/fileMock.js', | ||
}, | ||
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/.next/'], | ||
testEnvironment: 'jsdom', | ||
transform: { | ||
/* Use babel-jest to transpile tests with the next/babel preset | ||
https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object */ | ||
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }], | ||
}, | ||
transformIgnorePatterns: [ | ||
'/node_modules/', | ||
'^.+\\.module\\.(css|sass|scss)$', | ||
], | ||
} |
Oops, something went wrong.