@procore/hammer-test-jest 0.5.0 → 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/CHANGELOG.md ADDED
@@ -0,0 +1,55 @@
1
+ # @procore/hammer-test-jest
2
+
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f1e20cc: Added --serial flag for hammer test
8
+ - aab4a72: Added debug flag to hammer test
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [f1e20cc]
13
+ - Updated dependencies [aab4a72]
14
+ - @procore/hammer-types@0.3.1
15
+
16
+ ## 0.5.0
17
+
18
+ ### Minor Changes
19
+
20
+ - c831dd1: Upgrades package dependencies.
21
+
22
+ ## 0.4.0
23
+
24
+ ### Minor Changes
25
+
26
+ - 825ea36: Removes inspect plugin function.
27
+ - b5fd3e6: Updates interface types for test plugins and test CLI interface.
28
+
29
+ ### Patch Changes
30
+
31
+ - ccdff59: Fixes TypeScript configuration, and missing import type directives.
32
+ - 825ea36: Adds @procore/hammer-types to project.
33
+ - Updated dependencies [ccdff59]
34
+ - Updated dependencies [b5fd3e6]
35
+ - Updated dependencies [b5fd3e6]
36
+ - Updated dependencies [ae7df8b]
37
+ - @procore/hammer-types@0.3.0
38
+
39
+ ## 0.3.0
40
+
41
+ ### Minor Changes
42
+
43
+ - 1a97ddb: Upgrades package dependencies.
44
+
45
+ ## 0.2.0
46
+
47
+ ### Minor Changes
48
+
49
+ - 9e9fef7: Upgrades package dependencies.
50
+
51
+ ### Minor Changes
52
+
53
+ - 8e10c07: Jest plugin for test command
54
+
55
+ ## 0.1.0
package/dist/index.d.mts CHANGED
@@ -5,6 +5,8 @@ declare const test: (rootDir: string, config: _procore_hammer_types.HammerConfig
5
5
  coverage: boolean;
6
6
  ci: boolean;
7
7
  silent: boolean;
8
+ serial: boolean;
9
+ debug: boolean;
8
10
  }) => Promise<void>;
9
11
 
10
12
  export { test };
package/dist/index.d.ts CHANGED
@@ -5,6 +5,8 @@ declare const test: (rootDir: string, config: _procore_hammer_types.HammerConfig
5
5
  coverage: boolean;
6
6
  ci: boolean;
7
7
  silent: boolean;
8
+ serial: boolean;
9
+ debug: boolean;
8
10
  }) => Promise<void>;
9
11
 
10
12
  export { test };
package/dist/index.js CHANGED
@@ -34,12 +34,13 @@ __export(src_exports, {
34
34
  });
35
35
  module.exports = __toCommonJS(src_exports);
36
36
 
37
- // ../../node_modules/tsup/assets/cjs_shims.js
37
+ // ../../node_modules/.store/tsup-virtual-c87351f6b5/package/assets/cjs_shims.js
38
38
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
39
39
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
40
40
 
41
41
  // src/performTest.ts
42
42
  var jest = __toESM(require("jest-cli"));
43
+ var import_child_process = require("child_process");
43
44
 
44
45
  // src/config/utils.ts
45
46
  var import_fs2 = __toESM(require("fs"));
@@ -198,12 +199,16 @@ var allowedFlags = [
198
199
  "watch",
199
200
  "coverage",
200
201
  "ci",
201
- "silent"
202
+ "silent",
203
+ "serial",
204
+ "debug"
202
205
  ];
203
206
  function generateArgv(options) {
204
207
  const argv = [];
205
208
  for (const [key, value] of Object.entries(options)) {
206
- if (value && allowedFlags.includes(key)) {
209
+ if (value && key === "serial") {
210
+ argv.push(`--runInBand`);
211
+ } else if (value && allowedFlags.includes(key)) {
207
212
  argv.push(`--${key}`);
208
213
  }
209
214
  }
@@ -213,7 +218,20 @@ function generateArgv(options) {
213
218
  // src/performTest.ts
214
219
  async function performTest(options) {
215
220
  const config = JSON.stringify(getConfig(options));
216
- return jest.run(["--config", config, ...generateArgv(options)]);
221
+ const argv = generateArgv(options);
222
+ if (options.debug) {
223
+ const debugCommand = [
224
+ "--inspect-brk",
225
+ "./node_modules/jest/bin/jest.js",
226
+ "--runInBand",
227
+ "--config",
228
+ config,
229
+ ...argv
230
+ ];
231
+ (0, import_child_process.spawn)("node", debugCommand, { stdio: "inherit" });
232
+ } else {
233
+ return jest.run(["--config", config, ...argv]);
234
+ }
217
235
  }
218
236
 
219
237
  // src/index.ts
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  // src/performTest.ts
2
2
  import * as jest from "jest-cli";
3
+ import { spawn } from "child_process";
3
4
 
4
5
  // src/config/utils.ts
5
6
  import fs2 from "fs";
@@ -158,12 +159,16 @@ var allowedFlags = [
158
159
  "watch",
159
160
  "coverage",
160
161
  "ci",
161
- "silent"
162
+ "silent",
163
+ "serial",
164
+ "debug"
162
165
  ];
163
166
  function generateArgv(options) {
164
167
  const argv = [];
165
168
  for (const [key, value] of Object.entries(options)) {
166
- if (value && allowedFlags.includes(key)) {
169
+ if (value && key === "serial") {
170
+ argv.push(`--runInBand`);
171
+ } else if (value && allowedFlags.includes(key)) {
167
172
  argv.push(`--${key}`);
168
173
  }
169
174
  }
@@ -173,7 +178,20 @@ function generateArgv(options) {
173
178
  // src/performTest.ts
174
179
  async function performTest(options) {
175
180
  const config = JSON.stringify(getConfig(options));
176
- return jest.run(["--config", config, ...generateArgv(options)]);
181
+ const argv = generateArgv(options);
182
+ if (options.debug) {
183
+ const debugCommand = [
184
+ "--inspect-brk",
185
+ "./node_modules/jest/bin/jest.js",
186
+ "--runInBand",
187
+ "--config",
188
+ config,
189
+ ...argv
190
+ ];
191
+ spawn("node", debugCommand, { stdio: "inherit" });
192
+ } else {
193
+ return jest.run(["--config", config, ...argv]);
194
+ }
177
195
  }
178
196
 
179
197
  // src/index.ts
@@ -6,9 +6,9 @@ var __commonJS = (cb, mod) => function __require() {
6
6
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
7
7
  };
8
8
 
9
- // ../../node_modules/tsup/assets/esm_shims.js
9
+ // ../../node_modules/.store/tsup-virtual-c87351f6b5/package/assets/esm_shims.js
10
10
  var init_esm_shims = __esm({
11
- "../../node_modules/tsup/assets/esm_shims.js"() {
11
+ "../../node_modules/.store/tsup-virtual-c87351f6b5/package/assets/esm_shims.js"() {
12
12
  "use strict";
13
13
  }
14
14
  });