@procore/hammer-test-jest 0.10.0 → 0.12.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/CHANGELOG.md +25 -0
- package/README.md +12 -0
- package/dist/index.d.mts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +4 -1
- package/dist/index.mjs +4 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @procore/hammer-test-jest
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d6b682a: Added `--update` or `-u` flag to test command for updating snapshots.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [31f3d8c]
|
|
12
|
+
- Updated dependencies [d6b682a]
|
|
13
|
+
- @procore/hammer-types@0.8.0
|
|
14
|
+
|
|
15
|
+
## 0.11.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 53a92fe: Upgrades dependencies.
|
|
20
|
+
- a07d0ff: Updates the node engines version ranges to support current, active, and maintenance versions of Node.
|
|
21
|
+
- e0b46f0: Extend `HammerConfig` interface for typed configuration.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [3843fbe]
|
|
26
|
+
- @procore/hammer-types@0.7.0
|
|
27
|
+
|
|
3
28
|
## 0.10.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -12,6 +12,18 @@ Alternatively, you can install it directly:
|
|
|
12
12
|
yarn add -D @procore/hammer-test-jest
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## CLI Options
|
|
16
|
+
|
|
17
|
+
The plugin supports `@procore/hammer` CLI options, such as:
|
|
18
|
+
|
|
19
|
+
- `--watch` / `-w` - Watch files for changes and rerun tests
|
|
20
|
+
- `--coverage` - Collect and report test coverage information
|
|
21
|
+
- `--ci` - Run in CI environment mode
|
|
22
|
+
- `--silent` - Prevent tests from printing console messages
|
|
23
|
+
- `--serial` - Run tests serially in the current process
|
|
24
|
+
- `--debug` - Print debugging info about Jest configuration
|
|
25
|
+
- `--update` / `-u` - Update snapshots that are failing in this test run
|
|
26
|
+
|
|
15
27
|
## Configuration
|
|
16
28
|
|
|
17
29
|
Custom configuration is done using the `hammer` configuration file. The customization key is `jestOverride`, and the configuration that should be returned should be compatible with the `jest` format.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HammerConfig } from '@procore/hammer-types';
|
|
2
|
+
import { Config } from 'jest';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
declare
|
|
4
|
+
type OverrideConfig = (config: Config) => Config;
|
|
5
|
+
declare module '@procore/hammer-types' {
|
|
6
|
+
interface HammerConfig {
|
|
7
|
+
testJest?: OverrideConfig;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const init: (rootDir: string, config: HammerConfig) => Promise<void>;
|
|
12
|
+
declare const test: (rootDir: string, config: HammerConfig, options: {
|
|
5
13
|
watch: boolean;
|
|
6
14
|
coverage: boolean;
|
|
7
15
|
ci: boolean;
|
|
8
16
|
silent: boolean;
|
|
9
17
|
serial: boolean;
|
|
10
18
|
debug: boolean;
|
|
19
|
+
update: boolean;
|
|
11
20
|
fileFilters?: string[];
|
|
12
21
|
}) => Promise<void>;
|
|
13
22
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HammerConfig } from '@procore/hammer-types';
|
|
2
|
+
import { Config } from 'jest';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
declare
|
|
4
|
+
type OverrideConfig = (config: Config) => Config;
|
|
5
|
+
declare module '@procore/hammer-types' {
|
|
6
|
+
interface HammerConfig {
|
|
7
|
+
testJest?: OverrideConfig;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const init: (rootDir: string, config: HammerConfig) => Promise<void>;
|
|
12
|
+
declare const test: (rootDir: string, config: HammerConfig, options: {
|
|
5
13
|
watch: boolean;
|
|
6
14
|
coverage: boolean;
|
|
7
15
|
ci: boolean;
|
|
8
16
|
silent: boolean;
|
|
9
17
|
serial: boolean;
|
|
10
18
|
debug: boolean;
|
|
19
|
+
update: boolean;
|
|
11
20
|
fileFilters?: string[];
|
|
12
21
|
}) => Promise<void>;
|
|
13
22
|
|
package/dist/index.js
CHANGED
|
@@ -201,13 +201,16 @@ var allowedFlags = [
|
|
|
201
201
|
"coverage",
|
|
202
202
|
"ci",
|
|
203
203
|
"silent",
|
|
204
|
-
"debug"
|
|
204
|
+
"debug",
|
|
205
|
+
"update"
|
|
205
206
|
];
|
|
206
207
|
function generateArgv(options) {
|
|
207
208
|
const argv = [];
|
|
208
209
|
for (const [key, value] of Object.entries(options)) {
|
|
209
210
|
if (value && key === "serial") {
|
|
210
211
|
argv.push(`--runInBand`);
|
|
212
|
+
} else if (value && key === "update") {
|
|
213
|
+
argv.push(`--updateSnapshot`);
|
|
211
214
|
} else if (value && allowedFlags.includes(key)) {
|
|
212
215
|
argv.push(`--${key}`);
|
|
213
216
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -160,13 +160,16 @@ var allowedFlags = [
|
|
|
160
160
|
"coverage",
|
|
161
161
|
"ci",
|
|
162
162
|
"silent",
|
|
163
|
-
"debug"
|
|
163
|
+
"debug",
|
|
164
|
+
"update"
|
|
164
165
|
];
|
|
165
166
|
function generateArgv(options) {
|
|
166
167
|
const argv = [];
|
|
167
168
|
for (const [key, value] of Object.entries(options)) {
|
|
168
169
|
if (value && key === "serial") {
|
|
169
170
|
argv.push(`--runInBand`);
|
|
171
|
+
} else if (value && key === "update") {
|
|
172
|
+
argv.push(`--updateSnapshot`);
|
|
170
173
|
} else if (value && allowedFlags.includes(key)) {
|
|
171
174
|
argv.push(`--${key}`);
|
|
172
175
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procore/hammer-test-jest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Hammer test runner, jest",
|
|
5
5
|
"author": "Procore Technologies, Inc",
|
|
6
6
|
"homepage": "https://github.com/procore/hammer/packages/test-jest",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/procore/hammer.git",
|
|
10
|
-
"directory": "packages/
|
|
10
|
+
"directory": "packages/test-jest"
|
|
11
11
|
},
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|
|
13
13
|
"keywords": [],
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": "^
|
|
30
|
+
"node": "^20.19.0 || ^22.12.0 || ^24.0.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsup",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"test:watch": "vitest"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@babel/core": "^7.
|
|
47
|
-
"@babel/preset-env": "^7.
|
|
46
|
+
"@babel/core": "^7.28.0",
|
|
47
|
+
"@babel/preset-env": "^7.28.0",
|
|
48
48
|
"@babel/preset-react": "^7.27.1",
|
|
49
49
|
"@babel/preset-typescript": "^7.27.1",
|
|
50
|
-
"@procore/hammer-types": "^0.
|
|
50
|
+
"@procore/hammer-types": "^0.8.0",
|
|
51
51
|
"babel-jest": "^29.7.0",
|
|
52
52
|
"identity-obj-proxy": "^3.0.0",
|
|
53
53
|
"jest": "^29.7.0",
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
"jest-watch-typeahead": "^2.2.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@procore/eslint-config": "^15.2
|
|
58
|
+
"@procore/eslint-config": "^15.3.2",
|
|
59
59
|
"@procore/prettier-config": "^1.1.1",
|
|
60
|
-
"@procore/typescript-config": "^2.
|
|
61
|
-
"@types/node": "^20.19.
|
|
60
|
+
"@procore/typescript-config": "^2.1.0",
|
|
61
|
+
"@types/node": "^20.19.11",
|
|
62
62
|
"@vitest/coverage-v8": "^3.2.4",
|
|
63
63
|
"del-cli": "^6.0.0",
|
|
64
|
-
"eslint": "^9.
|
|
64
|
+
"eslint": "^9.33.0",
|
|
65
65
|
"pathe": "^2.0.3",
|
|
66
|
-
"prettier": "^3.6.
|
|
66
|
+
"prettier": "^3.6.2",
|
|
67
67
|
"tsup": "^8.5.0",
|
|
68
68
|
"typescript": "~5.5.4",
|
|
69
69
|
"vitest": "^3.2.4"
|