Skip to content
Snippets Groups Projects
Commit f191fea6 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

Merge branch 'jest-coverage' into 'dev'

test: show coverage in terminal

See merge request !329
parents 25ad1a1a 26e08346
No related branches found
No related tags found
2 merge requests!345V2.4.2,!329test: show coverage in terminal
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
project: true,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
......
import type { Config } from 'jest';
const config: Config = {
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '/src/.*\\.(test|spec).(ts|tsx|js)$',
collectCoverageFrom: ['src/**/*.{js,jsx,tsx,ts}', '!**/node_modules/**', '!**/vendor/**'],
reporters: ['default', 'jest-junit'],
};
export default config;
{
"moduleFileExtensions": ["ts", "tsx", "js", "json"],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "/src/.*\\.(test|spec).(ts|tsx|js)$",
"collectCoverageFrom": ["src/**/*.{js,jsx,tsx,ts}", "!**/node_modules/**", "!**/vendor/**"],
"coverageReporters": ["json", "lcov"],
"reporters": ["default", "jest-junit"]
}
......@@ -20,12 +20,12 @@
"release": "standard-version",
"start:debug": "nodemon --config nodemon-debug.json",
"start:dev": "nodemon",
"test": "jest --runInBand --config ./jest.json",
"start:prod": "npm run migrate:up && node dist/src/main",
"test:cov": "jest --config ./jest.json --coverage --ci --reporters=default --reporters=jest-junit",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test": "jest --runInBand --config ./jest.config.ts",
"test:cov": "jest --config ./jest.config.ts --coverage --ci --reporters=default --reporters=jest-junit",
"test:debug": "node --config ./jest.config.ts --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"test:watch": "jest --config ./jest.json --watch --coverage"
"test:watch": "jest --config ./jest.config.ts --watch --coverage"
},
"dependencies": {
"@elastic/elasticsearch": "~8.5.0",
......@@ -91,22 +91,5 @@
"ts-node": "^10.9.1",
"tsconfig-paths": "^3.9.0",
"typescript": "^4.2.4"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment