From 80f53777e06887bb026bca8de7590a55d213aca0 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 15 Dec 2017 14:07:30 +0100 Subject: [PATCH] feat: move jest config to external file --- README.md | 1 + jest.config.js | 18 ++++++++++++++++++ package.json | 18 ------------------ 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 jest.config.js diff --git a/README.md b/README.md index 09c4c0b..5cb705b 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ The full folder structure of this app is explained below: | .env.example | API keys, tokens, passwords, database URI. Clone this, but don't check it in to public repos. | | .travis.yml | Used to configure Travis CI build | | .copyStaticAssets.js | Build script that copies images, fonts, and JS libs to the dist folder | +| jest.config.js | Used to configure Jest | | package.json | File that contains npm dependencies as well as [build scripts](#what-if-a-library-isnt-on-definitelytyped) | | tsconfig.json | Config settings for compiling server code written in TypeScript | | tsconfig.tests.json | Config settings for compiling tests written in TypeScript | diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..6ea5c4a --- /dev/null +++ b/jest.config.js @@ -0,0 +1,18 @@ +module.exports = { + globals: { + 'ts-jest': { + tsConfigFile: 'tsconfig.json' + } + }, + moduleFileExtensions: [ + 'ts', + 'js' + ], + transform: { + '^.+\\.(ts|tsx)$': './node_modules/ts-jest/preprocessor.js' + }, + testMatch: [ + '**/test/**/*.test.(ts|js)' + ], + testEnvironment: 'node' +}; \ No newline at end of file diff --git a/package.json b/package.json index 2fb4c75..b5d57f5 100644 --- a/package.json +++ b/package.json @@ -24,24 +24,6 @@ "serve-debug": "nodemon --inspect dist/server.js", "watch-debug": "concurrently -k -p \"[{name}]\" -n \"Sass,TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run serve-debug\"" }, - "jest": { - "globals": { - "ts-jest": { - "tsConfigFile": "tsconfig.json" - } - }, - "moduleFileExtensions": [ - "ts", - "js" - ], - "transform": { - "^.+\\.(ts|tsx)$": "./node_modules/ts-jest/preprocessor.js" - }, - "testMatch": [ - "**/test/**/*.test.(ts|js)" - ], - "testEnvironment": "node" - }, "dependencies": { "async": "^2.5.0", "bcrypt-nodejs": "^0.0.3",