@procore/hammer-test-jest 0.2.0 → 0.4.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 +4 -1
- package/dist/index.d.mts +8 -17
- package/dist/index.d.ts +8 -17
- package/dist/index.js +7 -30
- package/dist/index.mjs +7 -29
- package/dist/transforms/file.test.js +4201 -4032
- package/dist/transforms/file.test.mjs +4201 -4032
- package/dist/transforms/reactSvg.test.js +4201 -4032
- package/dist/transforms/reactSvg.test.mjs +4201 -4032
- package/package.json +22 -22
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
|
-
[
|
|
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
|
|
1
|
+
import * as _procore_hammer_types from '@procore/hammer-types';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
|
1
|
+
import * as _procore_hammer_types from '@procore/hammer-types';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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/
|
|
43
|
-
var
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
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/
|
|
2
|
-
import
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
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
|
};
|