-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `yarn test` tests all packages while eg. `yarn mobx test` will test that package only.
- Loading branch information
Daniel K
committed
Nov 5, 2020
1 parent
a06d6cb
commit 7defd13
Showing
18 changed files
with
115 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const fs = require("fs") | ||
const path = require("path") | ||
|
||
const tsConfig = "tsconfig.test.json" | ||
|
||
module.exports = function buildConfig(packageDirectory, pkgConfig) { | ||
const packageName = require(`${packageDirectory}/package.json`).name | ||
const packageTsconfig = path.resolve(packageDirectory, tsConfig) | ||
return { | ||
preset: "ts-jest/presets/js-with-ts", | ||
globals: { | ||
__DEV__: true, | ||
"ts-jest": { | ||
tsconfig: fs.existsSync(packageTsconfig) | ||
? packageTsconfig | ||
: path.resolve(__dirname, tsConfig) | ||
} | ||
}, | ||
testRegex: "__tests__/.*\\.(j|t)sx?$", | ||
coverageDirectory: "<rootDir>/coverage/", | ||
collectCoverageFrom: ["<rootDir>/packages/*/src/**/*.{ts,tsx}"], | ||
displayName: packageName, | ||
...pkgConfig | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const buildConfig = require("./jest.base.config") | ||
|
||
module.exports = buildConfig(__dirname, { | ||
projects: ["<rootDir>/packages/*/jest.config.js"] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
module.exports = { | ||
preset: "ts-jest/presets/js-with-ts", | ||
const buildConfig = require("../../jest.base.config") | ||
|
||
globals: { | ||
"ts-jest": { | ||
tsconfig: "tsconfig.test.json" | ||
} | ||
}, | ||
module.exports = buildConfig(__dirname, { | ||
testRegex: "__tests__/.*\\.spec\\.(t|j)sx?$" | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
module.exports = { | ||
preset: "ts-jest/presets/js-with-ts", | ||
const buildConfig = require("../../jest.base.config") | ||
|
||
globals: { | ||
__DEV__: true, | ||
"ts-jest": { | ||
tsconfig: "tsconfig.test.json" | ||
} | ||
}, | ||
setupFilesAfterEnv: ["<rootDir>/__tests__/setup.ts"], | ||
module.exports = buildConfig(__dirname, { | ||
testRegex: "__tests__/v[4|5]/base/.*\\.(t|j)sx?$", | ||
collectCoverageFrom: ["<rootDir>/src/**/*.ts"] | ||
} | ||
setupFilesAfterEnv: [`<rootDir>/jest.setup.ts`] | ||
}) |
4 changes: 3 additions & 1 deletion
4
packages/mobx/__tests__/setup.ts → packages/mobx/jest.setup.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const fs = require("fs-extra") | ||
const path = require("path") | ||
const execa = require("execa") | ||
|
||
const run = () => { | ||
fs.copySync("flow-typed/mobx.js", "dist/index.js.flow") | ||
fs.copySync("../../README.md", "./README.md") | ||
fs.copySync("../../LICENSE", "./LICENSE") | ||
} | ||
|
||
run() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": ["esnext"], | ||
"noUnusedLocals": false, | ||
"moduleResolution": "node", | ||
"experimentalDecorators": true, | ||
"useDefineForClassFields": true, | ||
"allowSyntheticDefaultImports": true | ||
"allowJs": true, | ||
"noUnusedLocals": false | ||
} | ||
} |
Oops, something went wrong.