@vertexvis/jest-config-vertexvis 0.5.5 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/jest.config.js +4 -29
- package/package.json +14 -5
- package/tsconfig.json +2 -2
- package/.eslintrc.js +0 -3
package/README.md
CHANGED
|
@@ -21,9 +21,9 @@ Jest configuration file.
|
|
|
21
21
|
|
|
22
22
|
```js
|
|
23
23
|
// jest.config.js
|
|
24
|
-
|
|
24
|
+
import jestConfig from '@vertexvis/jest-config-vertexvis/jest.config';
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
export default jestConfig;
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
The Vertex Jest config supports overriding the default TypeScript settings. It
|
package/jest.config.js
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Attempts to determine the TypeScript config to use for Jest. This'll first
|
|
5
|
-
* look for a `tsconfig-jest.json` file in the root of a project. Otherwise,
|
|
6
|
-
* it'll fallback to using the default config file provided by the `build-tools`
|
|
7
|
-
* package.
|
|
8
|
-
*/
|
|
9
|
-
function resolveTsConfigForJest() {
|
|
10
|
-
try {
|
|
11
|
-
if (fs.existsSync('./tsconfig-jest.json')) {
|
|
12
|
-
return './tsconfig-jest.json';
|
|
13
|
-
} else {
|
|
14
|
-
return './node_modules/@vertexvis/jest-config-vertexvis/tsconfig.json';
|
|
15
|
-
}
|
|
16
|
-
} catch (e) {
|
|
17
|
-
console.error(
|
|
18
|
-
'Error reading project Jest config. Falling back to build-tools default'
|
|
19
|
-
);
|
|
20
|
-
return './node_modules/@vertexvis/jest-config-vertexvis/tsconfig.json';
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = {
|
|
1
|
+
export default {
|
|
25
2
|
preset: 'ts-jest',
|
|
3
|
+
transform: {
|
|
4
|
+
'^.+\\.tsx?$': ['ts-jest', { tsconfig: './tsconfig.json' }],
|
|
5
|
+
},
|
|
26
6
|
collectCoverageFrom: ['**/src/**', '!**/src/__*__/**'],
|
|
27
7
|
coverageThreshold: {
|
|
28
8
|
global: {
|
|
@@ -37,9 +17,4 @@ module.exports = {
|
|
|
37
17
|
'<rootDir>/node_modules/',
|
|
38
18
|
'<rootDir>/.rpt2_cache/',
|
|
39
19
|
],
|
|
40
|
-
globals: {
|
|
41
|
-
'ts-jest': {
|
|
42
|
-
tsconfig: resolveTsConfigForJest(),
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertexvis/jest-config-vertexvis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "The shared Vertex configs for Jest",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vertex Developers <support@vertexvis.com> (https://developer.vertexvis.com)",
|
|
@@ -12,7 +12,16 @@
|
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/Vertexvis/vertex-web-tools/issues"
|
|
14
14
|
},
|
|
15
|
-
"
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./jest.config.js",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./jest.config.js",
|
|
19
|
+
"./jest.config": "./jest.config.js",
|
|
20
|
+
"./jest.config.js": "./jest.config.js",
|
|
21
|
+
"./tsconfig": "./tsconfig.json",
|
|
22
|
+
"./tsconfig.json": "./tsconfig.json",
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
16
25
|
"publishConfig": {
|
|
17
26
|
"registry": "https://registry.npmjs.org/",
|
|
18
27
|
"access": "public"
|
|
@@ -20,13 +29,13 @@
|
|
|
20
29
|
"scripts": {
|
|
21
30
|
"build": "exit 0",
|
|
22
31
|
"format": "yarn lint --fix",
|
|
23
|
-
"lint": "eslint
|
|
32
|
+
"lint": "eslint ."
|
|
24
33
|
},
|
|
25
34
|
"dependencies": {
|
|
26
|
-
"@vertexvis/typescript-config-vertexvis": "1.
|
|
35
|
+
"@vertexvis/typescript-config-vertexvis": "1.3.0"
|
|
27
36
|
},
|
|
28
37
|
"devDependencies": {
|
|
29
|
-
"@vertexvis/eslint-config-vertexvis-typescript": "0.
|
|
38
|
+
"@vertexvis/eslint-config-vertexvis-typescript": "0.6.0",
|
|
30
39
|
"eslint": "^8.6.0"
|
|
31
40
|
}
|
|
32
41
|
}
|
package/tsconfig.json
CHANGED
package/.eslintrc.js
DELETED