@umijs/test 4.0.50 → 4.0.52

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.js CHANGED
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -28,13 +32,19 @@ __export(src_exports, {
28
32
  createConfig: () => createConfig
29
33
  });
30
34
  module.exports = __toCommonJS(src_exports);
35
+ var import_utils = require("@umijs/utils");
31
36
  var import_path = require("path");
32
37
  function getJSTransformer(jsTransformer, opts) {
33
38
  switch (jsTransformer) {
34
39
  case "esbuild":
35
40
  return [
36
41
  require.resolve((0, import_path.join)(__dirname, "transformers/esbuild")),
37
- { ...opts, sourcemap: true }
42
+ {
43
+ // See https://github.com/umijs/umi/issues/10412
44
+ target: "es2020",
45
+ ...opts,
46
+ sourcemap: true
47
+ }
38
48
  ];
39
49
  case "swc":
40
50
  return require.resolve("@swc-node/jest");
@@ -45,11 +55,13 @@ function getJSTransformer(jsTransformer, opts) {
45
55
  }
46
56
  }
47
57
  function createConfig(opts) {
58
+ (0, import_utils.setNoDeprecation)();
48
59
  const config = {
49
60
  testMatch: ["**/*.test.(t|j)s(x)?"],
50
61
  testPathIgnorePatterns: [
51
62
  "/node_modules/",
52
63
  "<rootDir>/config/",
64
+ // in case of config.test.ts
53
65
  "<rootDir>/mock/",
54
66
  "<rootDir>/.umirc.test.ts"
55
67
  ],
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
21
25
  mod2
22
26
  ));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/test",
3
- "version": "4.0.50",
3
+ "version": "4.0.52",
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",
@@ -23,7 +23,8 @@
23
23
  "dependencies": {
24
24
  "@babel/plugin-transform-modules-commonjs": "7.20.11",
25
25
  "@jest/types": "27.5.1",
26
- "@umijs/bundler-utils": "4.0.50",
26
+ "@umijs/bundler-utils": "4.0.52",
27
+ "@umijs/utils": "4.0.52",
27
28
  "babel-jest": "^29.3.1",
28
29
  "esbuild": "0.16.17",
29
30
  "identity-obj-proxy": "3.0.0",