Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
fixes jest
Browse files Browse the repository at this point in the history
  • Loading branch information
tol-is committed Apr 11, 2020
1 parent be6bedf commit eccd1ae
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 34 deletions.
56 changes: 56 additions & 0 deletions jest.config.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>'],
transform: {
'^.+\\.ts$': 'ts-jest',
'^.+\\.tsx$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(ts?|tsx?)?$',
moduleFileExtensions: ['js', 'ts', 'tsx', 'json', 'node'],
coveragePathIgnorePatterns: ['(tests/.*.mock).(|ts?|tsx?)$'],
verbose: true,
testPathIgnorePatterns: ['/__snapshots__/', '/.cache/'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|mp4|webm|wav|mp3|m4a|aac|oga)$': '../../../config/jest/fileMock.js',
'\\.(css)$': 'identity-obj-proxy',
},
collectCoverage: false,
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!<rootDir>/dist/'],
modulePathIgnorePatterns: ['/__snapshots__/', 'dummy', 'scripts', 'docs', '__tests__/lib/'],
snapshotSerializers: ['jest-emotion'],
globals: {
'process.env.__DEV__': true,
'process.env.__PROD__': false,
'process.env.__BROWSER__': false,
'process.env.__SERVER__': false,
},
};

// module.exports = {
// roots: ['<rootDir>'],
// transform: {
// '^.+\\.ts$': 'ts-jest',
// '^.+\\.tsx$': 'ts-jest',
// },
// testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(ts?|tsx?)?$',
// moduleFileExtensions: ['ts', 'tsx', 'jsx', 'json', 'node'],
// coveragePathIgnorePatterns: ['(tests/.*.mock).(|ts?|tsx?)$'],
// verbose: true,
// testPathIgnorePatterns: ['/__snapshots__/', '<rootDir>/packages/docs/.cache/'],
// moduleNameMapper: {
// '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|mp4|webm|wav|mp3|m4a|aac|oga)$': '../../../config/jest/fileMock.js',
// '\\.(css)$': 'identity-obj-proxy',
// },
// collectCoverage: false,

// collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!<rootDir>/dist/'],
// modulePathIgnorePatterns: ['/dummy', '/scripts', '/docs/', '__tests__/lib/', '/packages/docs/.cache/'],
// snapshotSerializers: ['jest-emotion'],
// globals: {
// 'process.env.__DEV__': true,
// 'process.env.__PROD__': false,
// 'process.env.__BROWSER__': false,
// 'process.env.__SERVER__': false,
// },
// };
26 changes: 0 additions & 26 deletions jest.config.base.ts

This file was deleted.

7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const base = require('./jest.config.base.js');

module.exports = {
...base,
projects: ['<rootDir>/packages/*/jest.config.js'],
setupFilesAfterEnv: ['./jest.setup.js'],
};
7 changes: 0 additions & 7 deletions jest.config.ts

This file was deleted.

1 change: 1 addition & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('@testing-library/jest-dom/extend-expect');
1 change: 0 additions & 1 deletion jest.setup.ts

This file was deleted.

0 comments on commit eccd1ae

Please sign in to comment.