Skip to content

Commit

Permalink
Move jest up to the root
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoespeon committed Sep 5, 2018
1 parent e0a400f commit b354f5a
Show file tree
Hide file tree
Showing 6 changed files with 291 additions and 641 deletions.
27 changes: 27 additions & 0 deletions jest.config.js
@@ -0,0 +1,27 @@
const baseProjectConfig = {
transform: {
"^.+\\.(ts|tsx)$": "ts-jest",
},
moduleFileExtensions: ["ts", "tsx", "js"],
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
};

module.exports = {
projects: [
{
...baseProjectConfig,
displayName: "core",
rootDir: "<rootDir>/packages/gitgraph-core/",
},
{
...baseProjectConfig,
displayName: "node",
rootDir: "<rootDir>/packages/gitgraph-node/",
},
{
...baseProjectConfig,
displayName: "react",
rootDir: "<rootDir>/packages/gitgraph-react/",
},
],
};
8 changes: 6 additions & 2 deletions package.json
Expand Up @@ -24,14 +24,18 @@
"build": "lerna run build",
"watch": "lerna run watch",
"pretest": "npm run build",
"test": "lerna run test",
"test": "jest",
"clean": "lerna clean"
},
"devDependencies": {
"@types/jest": "23.1.4",
"husky": "1.0.0-rc.12",
"jest": "23.3.0",
"lerna": "^2.5.1",
"prettier": "1.13.7",
"pretty-quick": "1.6.0"
"pretty-quick": "1.6.0",
"ts-jest": "23.0.0",
"typescript": "2.9.2"
},
"workspaces": [
"packages/*"
Expand Down
16 changes: 0 additions & 16 deletions packages/gitgraph-core/package.json
Expand Up @@ -28,8 +28,6 @@
"jsnext:main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"watch": "tsc -w",
"build": "run-s build:*",
"build:clear": "rimraf ./lib",
Expand All @@ -44,32 +42,18 @@
"lodash": "4.17.10"
},
"devDependencies": {
"@types/jest": "^21.1.8",
"@types/joi": "^13.4.0",
"@types/lodash": "^4.14.116",
"@types/node": "^9.4.6",
"browserify": "^14.5.0",
"jest": "^21.2.1",
"npm-run-all": "^4.1.2",
"rimraf": "^2.6.2",
"rollup": "^0.51.8",
"ts-jest": "^21.2.3",
"tslint": "^5.9.1",
"tslint-config-prettier": "^1.12.0",
"typescript": "^2.8.1",
"uglify-es": "^3.3.9"
},
"jest": {
"transform": {
".(ts)": "<rootDir>/../../node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": [
"ts",
"js",
"json"
]
},
"browser": {
"joi": "joi-browser"
}
Expand Down
18 changes: 0 additions & 18 deletions packages/gitgraph-node/package.json
Expand Up @@ -28,8 +28,6 @@
"scripts": {
"lint": "tslint src/**/*",
"lint:fix": "npm run lint -- --fix",
"test": "jest",
"test:watch": "jest --watch",
"example:default": "ts-node examples/default.ts",
"example:branches": "ts-node examples/branches.ts"
},
Expand All @@ -39,27 +37,11 @@
"lodash": "^4.17.10"
},
"devDependencies": {
"@types/jest": "^23.1.1",
"@types/lodash": "^4.14.110",
"@types/node": "^9.4.6",
"jest": "^23.1.0",
"ts-jest": "^21.2.3",
"ts-node": "^6.1.1",
"tslint": "^5.9.1",
"tslint-config-prettier": "1.13.0",
"typescript": "^2.8.1"
},
"jest": {
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
]
}
}
16 changes: 0 additions & 16 deletions packages/gitgraph-react/package.json
Expand Up @@ -30,8 +30,6 @@
"typings": "./lib/index.d.ts",
"scripts": {
"lint": "tslint --fix src/**/*",
"test": "jest",
"test:watch": "jest --watch",
"watch": "tsc -w",
"build": "run-s build:*",
"build:clear": "rimraf ./lib",
Expand All @@ -52,7 +50,6 @@
"@storybook/addon-knobs": "^3.3.15",
"@storybook/addons": "^3.3.15",
"@storybook/react": "^3.3.15",
"@types/jest": "^21.1.8",
"@types/node": "^9.4.6",
"@types/react": "^16.0.40",
"@types/react-dom": "^16.0.4",
Expand All @@ -61,26 +58,13 @@
"@types/storybook__react": "^3.0.7",
"babel-core": "^6.26.0",
"browserify": "^14.5.0",
"jest": "^21.2.1",
"npm-run-all": "^4.1.2",
"rimraf": "^2.6.2",
"rollup": "^0.51.8",
"ts-jest": "^21.2.3",
"ts-loader": "3.5.0",
"tslint": "^5.9.1",
"tslint-config-prettier": "1.13.0",
"typescript": "^2.8.1",
"uglify-es": "^3.3.9"
},
"jest": {
"transform": {
".(ts)": "<rootDir>/../../node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": [
"ts",
"js",
"json"
]
}
}

0 comments on commit b354f5a

Please sign in to comment.