mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-08-06 06:54:19 -07:00
Addresses issue #11 items unit testing, snapshot testing. Follows instructions from https://www.gatsbyjs.com/docs/how-to/testing/unit-testing/ ; Adding typescript config, mocks, snapshot capabilities; initial test for j40footer and snapshot, readme update, test helper for intl plugin (#79)
This commit is contained in:
parent
a432a0d8c9
commit
ce7245b1a2
11 changed files with 3633 additions and 27 deletions
19
client/jest.config.js
Normal file
19
client/jest.config.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.[jt]sx?$': '<rootDir>/jest-preprocess.js',
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'.+\\.(css|styl|less|sass|scss)$': `identity-obj-proxy`,
|
||||
// eslint-disable-next-line max-len
|
||||
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `<rootDir>/__mocks__/file-mock.js`,
|
||||
},
|
||||
testPathIgnorePatterns: [`node_modules`, `\\.cache`, `<rootDir>.*/public`],
|
||||
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
|
||||
globals: {
|
||||
__PATH_PREFIX__: ``,
|
||||
},
|
||||
testURL: `http://localhost`,
|
||||
setupFiles: [`<rootDir>/loadershim.js`],
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue