@procore/hammer-test-jest 0.3.0 → 0.5.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 CHANGED
@@ -38,10 +38,13 @@ This project uses [`yarn`][yarn], and supports the following commands:
38
38
  - `clean`: deletes the output directory and any built files.
39
39
  - `format`: runs [`prettier`][prettier] on the project.
40
40
  - `format:check`: uses [`prettier`][prettier] to validate code format.
41
+ - `lint:code`: uses [`eslint`][eslint] to lint code.
42
+ - `lint:types`: uses [`TypeScript`][typescript] to validate types.
41
43
  - `test`: runs the unit test suite.
42
44
  - `test:ci`: run the unit test suite, reporting coverage.
43
45
 
46
+ [eslint]: https://eslint.org/
44
47
  [jest]: https://jestjs.io/
45
48
  [prettier]: https://prettier.io/
46
- [tsup]: https://tsup.egoist.dev/
49
+ [typescript]: https://www.typescriptlang.org/
47
50
  [yarn]: https://classic.yarnpkg.com/
package/dist/index.d.mts CHANGED
@@ -1,19 +1,10 @@
1
- import { Config } from 'jest';
1
+ import * as _procore_hammer_types from '@procore/hammer-types';
2
2
 
3
- type OverrideFn = (config: Config) => Config;
4
- type PluginOptions = {
5
- watch?: boolean;
6
- W?: boolean;
7
- coverage?: boolean;
8
- ci?: boolean;
9
- silent?: boolean;
10
- config: {
11
- testJest?: OverrideFn;
12
- };
13
- rootDir: string;
14
- };
3
+ declare const test: (rootDir: string, config: _procore_hammer_types.HammerConfig, options: {
4
+ watch: boolean;
5
+ coverage: boolean;
6
+ ci: boolean;
7
+ silent: boolean;
8
+ }) => Promise<void>;
15
9
 
16
- declare function test(options: PluginOptions): Promise<void>;
17
- declare function inspect(options: PluginOptions): Promise<void>;
18
-
19
- export { inspect, test };
10
+ export { test };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,10 @@
1
- import { Config } from 'jest';
1
+ import * as _procore_hammer_types from '@procore/hammer-types';
2
2
 
3
- type OverrideFn = (config: Config) => Config;
4
- type PluginOptions = {
5
- watch?: boolean;
6
- W?: boolean;
7
- coverage?: boolean;
8
- ci?: boolean;
9
- silent?: boolean;
10
- config: {
11
- testJest?: OverrideFn;
12
- };
13
- rootDir: string;
14
- };
3
+ declare const test: (rootDir: string, config: _procore_hammer_types.HammerConfig, options: {
4
+ watch: boolean;
5
+ coverage: boolean;
6
+ ci: boolean;
7
+ silent: boolean;
8
+ }) => Promise<void>;
15
9
 
16
- declare function test(options: PluginOptions): Promise<void>;
17
- declare function inspect(options: PluginOptions): Promise<void>;
18
-
19
- export { inspect, test };
10
+ export { test };
package/dist/index.js CHANGED
@@ -30,7 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
- inspect: () => inspect,
34
33
  test: () => test
35
34
  });
36
35
  module.exports = __toCommonJS(src_exports);
@@ -39,8 +38,8 @@ module.exports = __toCommonJS(src_exports);
39
38
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
40
39
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
41
40
 
42
- // src/index.ts
43
- var import_node_process = __toESM(require("process"));
41
+ // src/performTest.ts
42
+ var jest = __toESM(require("jest-cli"));
44
43
 
45
44
  // src/config/utils.ts
46
45
  var import_fs2 = __toESM(require("fs"));
@@ -194,26 +193,9 @@ function getConfig(options) {
194
193
  return options.config.testJest ? options.config.testJest(config) : config;
195
194
  }
196
195
 
197
- // src/utils/terminal.ts
198
- var import_cli_highlight = require("cli-highlight");
199
- function toHighlightedString(input) {
200
- const inputAsString = JSON.stringify(
201
- input,
202
- function(_key, value) {
203
- return typeof value === "function" ? value.toString() : value;
204
- },
205
- 2
206
- );
207
- return (0, import_cli_highlight.highlight)(inputAsString, { language: "js" });
208
- }
209
-
210
- // src/performTest.ts
211
- var jest = __toESM(require("jest-cli"));
212
-
213
196
  // src/utils/argvForJest.ts
214
197
  var allowedFlags = [
215
198
  "watch",
216
- "W",
217
199
  "coverage",
218
200
  "ci",
219
201
  "silent"
@@ -235,17 +217,12 @@ async function performTest(options) {
235
217
  }
236
218
 
237
219
  // src/index.ts
238
- async function test(options) {
239
- await performTest(options);
240
- }
241
- async function inspect(options) {
242
- const highlightedConfig = toHighlightedString(getConfig(options));
243
- import_node_process.default.stdout.write(`
244
- ${highlightedConfig}
245
- `);
246
- }
220
+ var { test } = {
221
+ test: async function test2(rootDir, config, options) {
222
+ await performTest({ ...options, rootDir, config });
223
+ }
224
+ };
247
225
  // Annotate the CommonJS export names for ESM import in node:
248
226
  0 && (module.exports = {
249
- inspect,
250
227
  test
251
228
  });
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- // src/index.ts
2
- import process from "node:process";
1
+ // src/performTest.ts
2
+ import * as jest from "jest-cli";
3
3
 
4
4
  // src/config/utils.ts
5
5
  import fs2 from "fs";
@@ -153,26 +153,9 @@ function getConfig(options) {
153
153
  return options.config.testJest ? options.config.testJest(config) : config;
154
154
  }
155
155
 
156
- // src/utils/terminal.ts
157
- import { highlight } from "cli-highlight";
158
- function toHighlightedString(input) {
159
- const inputAsString = JSON.stringify(
160
- input,
161
- function(_key, value) {
162
- return typeof value === "function" ? value.toString() : value;
163
- },
164
- 2
165
- );
166
- return highlight(inputAsString, { language: "js" });
167
- }
168
-
169
- // src/performTest.ts
170
- import * as jest from "jest-cli";
171
-
172
156
  // src/utils/argvForJest.ts
173
157
  var allowedFlags = [
174
158
  "watch",
175
- "W",
176
159
  "coverage",
177
160
  "ci",
178
161
  "silent"
@@ -194,16 +177,11 @@ async function performTest(options) {
194
177
  }
195
178
 
196
179
  // src/index.ts
197
- async function test(options) {
198
- await performTest(options);
199
- }
200
- async function inspect(options) {
201
- const highlightedConfig = toHighlightedString(getConfig(options));
202
- process.stdout.write(`
203
- ${highlightedConfig}
204
- `);
205
- }
180
+ var { test } = {
181
+ test: async function test2(rootDir, config, options) {
182
+ await performTest({ ...options, rootDir, config });
183
+ }
184
+ };
206
185
  export {
207
- inspect,
208
186
  test
209
187
  };