Files
remark42/frontend/jest.config.js
T
Pavel MineevandUmputun 5825a55b69 Update frontend
* change root dit and change way to import modules
* update deps to latest versions
* use latest tools for building bundles
* rewrite webpack config
* use nomodule technique for loading modern bundle
* inject polyfills by babel usebuiltins
* update eslint rules
* rename all style files to CSS
* use postcss preset env for building styles
* proper typescript typing
* put all html files to templates folder
* etc
2021-01-12 13:39:26 -06:00

31 lines
892 B
JavaScript

module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.jsx?$': 'babel-jest',
},
moduleDirectories: ['node_modules', 'app'],
moduleNameMapper: {
'\\.css': 'identity-obj-proxy',
'^react$': 'preact/compat',
'^react-dom$': 'preact/compat',
/**
* "transformIgnorePatterns" just don't work for modules down below
* If you know how to handle it better PR welcome
*/
'^@github/markdown-toolbar-element$': 'identity-obj-proxy',
'^@github/text-expander-element$': 'identity-obj-proxy',
},
setupFiles: ['<rootDir>/jest.setup.ts'],
setupFilesAfterEnv: [
'jest-localstorage-mock',
'<rootDir>/app/__mocks__/headers.ts',
'<rootDir>/app/__stubs__/static-config.ts',
],
collectCoverageFrom: ['!**/__mocks__/**', '!**/__stubs__/**', '!app/locales/**'],
globals: {
'ts-jest': {
babelConfig: true,
},
},
};