Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b4be5d5

Browse filesBrowse files
committed
Nodemon and Jest configuration working
1 parent 4b30e52 commit b4be5d5
Copy full SHA for b4be5d5

File tree

5 files changed

+20
-5
lines changed
Filter options

5 files changed

+20
-5
lines changed

‎.eslintignore

Copy file name to clipboardExpand all lines: .eslintignore
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
build
33

44
jest.config.js
5+
jest.dev.config.js
56
jest.build.config.js

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ install:
1414
- yarn db migration:run
1515
- yarn db:seeding seed
1616
script:
17-
- yarn test --roots build/tests
1817
- yarn test
18+
- yarn prod:test
1919
- yarn eslint
2020
- yarn ejslint
2121
notifications:

‎README.md

Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mutation {
3939
Before to send a PR please do it:
4040
- Run `yarn test` to run the test in dev environment.
4141
- Run `yarn build` to ensure build is working.
42-
- Run `yarn test --roots build/tests` to run the test in with the js files.
42+
- Run `yarn prod:test` to run the test in with the js files.
4343
- Run `yarn eslint --fix` to validate the code style.
4444
- Run `yarn ejslint --fix` to validate the ejs files.
4545

‎jest.dev.config.js

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// For a detailed explanation regarding each configuration property, visit:
2+
// https://jestjs.io/docs/en/configuration.html
3+
4+
const { pathsToModuleNameMapper } = require('ts-jest/utils');
5+
const { compilerOptions } = require('./tsconfig');
6+
const jestConfig = require('./jest.config');
7+
8+
module.exports = {
9+
...jestConfig,
10+
moduleNameMapper: pathsToModuleNameMapper(
11+
compilerOptions.paths ,
12+
{ prefix: '<rootDir>/src' },
13+
),
14+
};

‎package.json

Copy file name to clipboardExpand all lines: package.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"main": "index.js",
66
"scripts": {
77
"build": "rm -rf build/ && tsc && tscpaths -p tsconfig.json -s ./src -o ./build && cp -R src/resources build/resources",
8-
"start": "ts-node src/index.ts",
9-
"dev": "nodemon --exec ts-node src/index.ts",
8+
"dev": "nodemon --exec ts-node -r tsconfig-paths/register src/index.ts",
9+
"test": "jest --config ./jest.dev.config.js --roots src/tests",
1010
"eslint": "eslint --ext=jsx,ts,tsx 'src/**/*.{ts,tsx}'",
11-
"test": "jest --config ./jest.config.js",
1211
"ejslint": "ejslint src/resources/view/*",
1312
"typeorm": "ts-node ./node_modules/typeorm/cli.js --config src/init/db/connectionOptions.ts",
1413
"seeding": "ts-node ./node_modules/typeorm-seeding/dist/cli.js --configName src/init/db/connectionOptions.ts",
14+
"prod:test": "jest --config ./jest.config.js --roots build/tests",
1515
"db": "node ./node_modules/typeorm/cli.js --config build/init/db/connectionOptions.js",
1616
"db:seeding": "node ./node_modules/typeorm-seeding/dist/cli.js --configName build/init/db/connectionOptions.js"
1717
},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.