diff --git a/.gitignore b/.gitignore index 70ddc5d..f6c15fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules build .vscode -.idea \ No newline at end of file +.idea +coverage \ No newline at end of file diff --git a/README.md b/README.md index 356756a..01d302a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a template repository. So just use the template and once you have your r ## Scripts -```javascript +```json "prepare": "npm run build", "prestart": "npm run build", "start": "node build/index.js", @@ -13,23 +13,24 @@ This is a template repository. So just use the template and once you have your r "lint": "eslint . --ext .ts", "lint:fix": "npm run lint -- --fix", "test": "jest --verbose", -"test:tdd": "npm t -- --watchAll" +"test:watch": "npm t -- --watchAll", +"test:coverage": "npm t -- --coverage" ``` ## Test config -```javascript +```json { "roots": [ "/src" - ], - "testMatch": [ - "**/__tests__/**/*.+(ts|js)", + ], + "testMatch": [ + "**/__tests__/**/*.+(ts|js)", "**/?(*.)+(spec|test).+(ts|js)" - ], - "transform": { + ], + "transform": { "^.+\\.(ts)?$": "ts-jest" - } + } } ``` diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index b2fac37..0000000 --- a/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - roots: ['/src'], - testMatch: ['**/__tests__/**/*.+(ts|js)', '**/?(*.)+(spec|test).+(ts|js)'], - transform: { - '^.+\\.(ts)?$': 'ts-jest' - } -} diff --git a/jest.config.json b/jest.config.json new file mode 100644 index 0000000..a036257 --- /dev/null +++ b/jest.config.json @@ -0,0 +1,12 @@ +{ + "roots": [ + "/src" + ], + "testMatch": [ + "**/__tests__/**/*.+(ts|js)", + "**/?(*.)+(spec|test).+(ts|js)" + ], + "transform": { + "^.+\\.(ts)?$": "ts-jest" + } +} diff --git a/package.json b/package.json index 35ee9dc..43e323a 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "lint": "eslint . --ext .ts", "lint:fix": "npm run lint -- --fix", "test": "jest --verbose", - "test:tdd": "npm t -- --watchAll" + "test:watch": "npm t -- --watchAll", + "test:coverage": "npm t -- --coverage" }, "repository": { "type": "git", @@ -46,4 +47,4 @@ "ts-jest": "^26.1.3", "typescript": "^3.9.7" } -} \ No newline at end of file +}