@umijs/test 4.0.7 → 4.0.8
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/dist/index.d.ts +0 -0
- package/dist/index.js +61 -34
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -1,38 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// index.ts
|
|
23
|
+
var src_exports = {};
|
|
24
|
+
__export(src_exports, {
|
|
25
|
+
createConfig: () => createConfig
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
4
28
|
function getJSTransformer(jsTransformer) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
29
|
+
switch (jsTransformer) {
|
|
30
|
+
case "esbuild":
|
|
31
|
+
return [require.resolve("esbuild-jest"), { sourcemap: true }];
|
|
32
|
+
case "swc":
|
|
33
|
+
return require.resolve("@swc-node/jest");
|
|
34
|
+
case "ts-jest":
|
|
35
|
+
return require.resolve("ts-jest");
|
|
36
|
+
default:
|
|
37
|
+
throw new Error(`Unknown jsTransformer: ${jsTransformer}`);
|
|
38
|
+
}
|
|
15
39
|
}
|
|
16
40
|
function createConfig(opts) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
const config = {
|
|
42
|
+
testMatch: ["**/*.test.(t|j)s(x)?"],
|
|
43
|
+
transform: {
|
|
44
|
+
"^.+\\.tsx?$": getJSTransformer((opts == null ? void 0 : opts.jsTransformer) || "esbuild"),
|
|
45
|
+
"^.+\\.jsx?$": getJSTransformer((opts == null ? void 0 : opts.jsTransformer) || "esbuild")
|
|
46
|
+
},
|
|
47
|
+
moduleNameMapper: {
|
|
48
|
+
"^.+\\.(css|less|sass|scss|stylus)$": require.resolve("identity-obj-proxy")
|
|
49
|
+
},
|
|
50
|
+
testTimeout: 3e4,
|
|
51
|
+
modulePathIgnorePatterns: [
|
|
52
|
+
"<rootDir>/packages/.+/compiled",
|
|
53
|
+
"<rootDir>/packages/.+/fixtures"
|
|
54
|
+
],
|
|
55
|
+
setupFiles: [require.resolve("../setupFiles/shim")]
|
|
56
|
+
};
|
|
57
|
+
if ((opts == null ? void 0 : opts.target) === "browser") {
|
|
58
|
+
config.testEnvironment = "jsdom";
|
|
59
|
+
}
|
|
60
|
+
return config;
|
|
37
61
|
}
|
|
38
|
-
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
createConfig
|
|
65
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/test",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "@umijs/test",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/testing#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"setupFiles"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "pnpm
|
|
19
|
+
"build": "pnpm father build",
|
|
20
20
|
"build:deps": "umi-scripts bundleDeps",
|
|
21
|
-
"dev": "pnpm
|
|
21
|
+
"dev": "pnpm father dev"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@jest/types": "27.5.1",
|