tmpl-cli
api
docs
env
git
hbs
html
husky
jest
jestjest -t
lintstaged
lisp
node
prettier
python
react
readme
schema
style
util
vue
web

$ tmpl jest -t

Sub CLI for jest install. Creates a jest.config.js and installs.

Force typescript

Files

project
└─jest.config.js
└─jest.setup.js

jest.config.js

module.exports = {
clearMocks: true,
collectCoverage: false,
collectCoverageFrom: [
// Match Pattern
"**/*.{js,jsx,ts,tsx}",
// Ignore Directories
"!**.expected.**",
"!**/__tests__/**",
"!**/assets/**",
"!**/bin/**",
"!**/cli/**",
"!**/coverage/**",
"!**/dist/**",
"!**/env/**",
"!**/node_modules/**",
"!**/tests/**",
"!**/types/**",
"!**/vendor/**",
// Ignore Files
"!**/**.config.**"
],
coverageDirectory: "coverage",
coveragePathIgnorePatterns: ["/cli/", "/node_modules/"],
globals: {
"ts-jest": {
tsconfig: "tsconfig.json"
}
},
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "vue", "json"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"@env/(.*)": "<rootDir>/env/$1",
"@modules/(.*)": "<rootDir>/node_modules/$1"
},
modulePathIgnorePatterns: [],
testMatch: [
"**/index.test.(js|jsx|ts|tsx)",
"**/__tests__/*test.+(js|jsx|ts|tsx)",
"**/tests/integration/*test.+(js|jsx|ts|tsx)"
],
testPathIgnorePatterns: ["/node_modules/"],
transformIgnorePatterns: ["<rootDir>/node_modules/"],
transform: {
"^.+\\.tsx?$": "ts-jest"
}
};

jest.setup.js