@modern-js/plugin-testing 2.48.0 → 2.48.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/base/config/testConfigOperator.js +2 -6
- package/dist/cjs/runtime-testing/app.js +0 -2
- package/dist/esm/base/config/testConfigOperator.js +35 -53
- package/dist/esm/runtime-testing/app.js +21 -31
- package/dist/esm-node/base/config/testConfigOperator.js +2 -6
- package/dist/esm-node/runtime-testing/app.js +0 -2
- package/package.json +13 -13
@@ -21,7 +21,6 @@ __export(testConfigOperator_exports, {
|
|
21
21
|
TestConfigOperator: () => TestConfigOperator
|
22
22
|
});
|
23
23
|
module.exports = __toCommonJS(testConfigOperator_exports);
|
24
|
-
var import_define_property = require("@swc/helpers/_/_define_property");
|
25
24
|
var import_lodash = require("@modern-js/utils/lodash");
|
26
25
|
class TestConfigOperator {
|
27
26
|
initial() {
|
@@ -66,12 +65,9 @@ class TestConfigOperator {
|
|
66
65
|
return this.jestConfig;
|
67
66
|
}
|
68
67
|
constructor(testConfig) {
|
69
|
-
|
70
|
-
(0, import_define_property._)(this, "_jestConfig", void 0);
|
71
|
-
(0, import_define_property._)(this, "userJestConfig", void 0);
|
72
|
-
(0, import_define_property._)(this, "defaultTestConfig", {
|
68
|
+
this.defaultTestConfig = {
|
73
69
|
transformer: "babel-jest"
|
74
|
-
}
|
70
|
+
};
|
75
71
|
this._testConfig = testConfig;
|
76
72
|
this._jestConfig = {};
|
77
73
|
this.userJestConfig = testConfig.jest;
|
@@ -31,7 +31,6 @@ __export(app_exports, {
|
|
31
31
|
default: () => app_default
|
32
32
|
});
|
33
33
|
module.exports = __toCommonJS(app_exports);
|
34
|
-
var import_define_property = require("@swc/helpers/_/_define_property");
|
35
34
|
var import_runtime = require("@modern-js/runtime");
|
36
35
|
var import_constant = require("../constant");
|
37
36
|
var import_resolvePlugins = __toESM(require("./resolvePlugins"));
|
@@ -61,7 +60,6 @@ class ModernRuntime {
|
|
61
60
|
})(Component);
|
62
61
|
}
|
63
62
|
constructor(options) {
|
64
|
-
(0, import_define_property._)(this, "options", void 0);
|
65
63
|
this.options = options;
|
66
64
|
}
|
67
65
|
}
|
@@ -1,30 +1,53 @@
|
|
1
1
|
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
|
2
2
|
import { _ as _create_class } from "@swc/helpers/_/_create_class";
|
3
|
-
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
4
3
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
5
4
|
import { merge } from "@modern-js/utils/lodash";
|
6
5
|
var TestConfigOperator = /* @__PURE__ */ function() {
|
7
6
|
"use strict";
|
8
7
|
function TestConfigOperator2(testConfig) {
|
9
8
|
_class_call_check(this, TestConfigOperator2);
|
10
|
-
|
11
|
-
_define_property(this, "_jestConfig", void 0);
|
12
|
-
_define_property(this, "userJestConfig", void 0);
|
13
|
-
_define_property(this, "defaultTestConfig", {
|
9
|
+
this.defaultTestConfig = {
|
14
10
|
transformer: "babel-jest"
|
15
|
-
}
|
11
|
+
};
|
16
12
|
this._testConfig = testConfig;
|
17
13
|
this._jestConfig = {};
|
18
14
|
this.userJestConfig = testConfig.jest;
|
19
15
|
this.initial();
|
20
16
|
}
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
var _proto = TestConfigOperator2.prototype;
|
18
|
+
_proto.initial = function initial() {
|
19
|
+
this._testConfig = merge({}, this.defaultTestConfig, this.testConfig);
|
20
|
+
};
|
21
|
+
_proto.mergeJestConfig = function mergeJestConfig(sourceConfig) {
|
22
|
+
this._jestConfig = merge({}, this._jestConfig, sourceConfig);
|
23
|
+
};
|
24
|
+
_proto.setJestUserConfig = function setJestUserConfig() {
|
25
|
+
var userJestConfig = this.userJestConfig;
|
26
|
+
if (typeof userJestConfig === "object") {
|
27
|
+
this.setJestConfig(userJestConfig);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
_proto.setJestConfig = function setJestConfig(sourceConfig, options) {
|
31
|
+
if (options) {
|
32
|
+
var force = options.force;
|
33
|
+
if (force) {
|
34
|
+
this._jestConfig = sourceConfig;
|
35
|
+
return;
|
26
36
|
}
|
27
|
-
}
|
37
|
+
}
|
38
|
+
this._jestConfig = _object_spread({}, this._jestConfig, sourceConfig);
|
39
|
+
};
|
40
|
+
_proto.getFinalConfig = function getFinalConfig() {
|
41
|
+
var userJestConfig = this.userJestConfig;
|
42
|
+
if (!userJestConfig) {
|
43
|
+
return this._jestConfig;
|
44
|
+
}
|
45
|
+
if (typeof userJestConfig === "function") {
|
46
|
+
return userJestConfig(this._jestConfig);
|
47
|
+
}
|
48
|
+
return this.jestConfig;
|
49
|
+
};
|
50
|
+
_create_class(TestConfigOperator2, [
|
28
51
|
{
|
29
52
|
key: "jestConfig",
|
30
53
|
get: function get() {
|
@@ -36,47 +59,6 @@ var TestConfigOperator = /* @__PURE__ */ function() {
|
|
36
59
|
get: function get() {
|
37
60
|
return this._testConfig;
|
38
61
|
}
|
39
|
-
},
|
40
|
-
{
|
41
|
-
key: "mergeJestConfig",
|
42
|
-
value: function mergeJestConfig(sourceConfig) {
|
43
|
-
this._jestConfig = merge({}, this._jestConfig, sourceConfig);
|
44
|
-
}
|
45
|
-
},
|
46
|
-
{
|
47
|
-
key: "setJestUserConfig",
|
48
|
-
value: function setJestUserConfig() {
|
49
|
-
var userJestConfig = this.userJestConfig;
|
50
|
-
if (typeof userJestConfig === "object") {
|
51
|
-
this.setJestConfig(userJestConfig);
|
52
|
-
}
|
53
|
-
}
|
54
|
-
},
|
55
|
-
{
|
56
|
-
key: "setJestConfig",
|
57
|
-
value: function setJestConfig(sourceConfig, options) {
|
58
|
-
if (options) {
|
59
|
-
var force = options.force;
|
60
|
-
if (force) {
|
61
|
-
this._jestConfig = sourceConfig;
|
62
|
-
return;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
this._jestConfig = _object_spread({}, this._jestConfig, sourceConfig);
|
66
|
-
}
|
67
|
-
},
|
68
|
-
{
|
69
|
-
key: "getFinalConfig",
|
70
|
-
value: function getFinalConfig() {
|
71
|
-
var userJestConfig = this.userJestConfig;
|
72
|
-
if (!userJestConfig) {
|
73
|
-
return this._jestConfig;
|
74
|
-
}
|
75
|
-
if (typeof userJestConfig === "function") {
|
76
|
-
return userJestConfig(this._jestConfig);
|
77
|
-
}
|
78
|
-
return this.jestConfig;
|
79
|
-
}
|
80
62
|
}
|
81
63
|
]);
|
82
64
|
return TestConfigOperator2;
|
@@ -1,6 +1,4 @@
|
|
1
1
|
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
|
2
|
-
import { _ as _create_class } from "@swc/helpers/_/_create_class";
|
3
|
-
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
4
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
5
3
|
import { createApp } from "@modern-js/runtime";
|
6
4
|
import { MODERNJS_CONFIG_KEY } from "../constant";
|
@@ -9,38 +7,30 @@ var ModernRuntime = /* @__PURE__ */ function() {
|
|
9
7
|
"use strict";
|
10
8
|
function ModernRuntime2(options) {
|
11
9
|
_class_call_check(this, ModernRuntime2);
|
12
|
-
_define_property(this, "options", void 0);
|
13
10
|
this.options = options;
|
14
11
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
},
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
var _ref = props || {}, entry = _ref.entry, children = _ref.children;
|
27
|
-
var runtimeFeatures = (_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.runtime;
|
28
|
-
if (entry) {
|
29
|
-
var _this_options_runtimeByEntries;
|
30
|
-
runtimeFeatures = _object_spread({}, runtimeFeatures || {}, (_this_options_runtimeByEntries = this.options.runtimeByEntries) === null || _this_options_runtimeByEntries === void 0 ? void 0 : _this_options_runtimeByEntries[entry]);
|
31
|
-
}
|
32
|
-
var Component = function() {
|
33
|
-
if (!children) {
|
34
|
-
return null;
|
35
|
-
}
|
36
|
-
return children;
|
37
|
-
};
|
38
|
-
return createApp({
|
39
|
-
plugins: resolvePlugins(runtimeFeatures || {})
|
40
|
-
})(Component);
|
41
|
-
}
|
12
|
+
var _proto = ModernRuntime2.prototype;
|
13
|
+
_proto.init = function init(options) {
|
14
|
+
this.options = options;
|
15
|
+
};
|
16
|
+
_proto.createApp = function createApp1(props) {
|
17
|
+
var _this_options;
|
18
|
+
var _ref = props || {}, entry = _ref.entry, children = _ref.children;
|
19
|
+
var runtimeFeatures = (_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.runtime;
|
20
|
+
if (entry) {
|
21
|
+
var _this_options_runtimeByEntries;
|
22
|
+
runtimeFeatures = _object_spread({}, runtimeFeatures || {}, (_this_options_runtimeByEntries = this.options.runtimeByEntries) === null || _this_options_runtimeByEntries === void 0 ? void 0 : _this_options_runtimeByEntries[entry]);
|
42
23
|
}
|
43
|
-
|
24
|
+
var Component = function() {
|
25
|
+
if (!children) {
|
26
|
+
return null;
|
27
|
+
}
|
28
|
+
return children;
|
29
|
+
};
|
30
|
+
return createApp({
|
31
|
+
plugins: resolvePlugins(runtimeFeatures || {})
|
32
|
+
})(Component);
|
33
|
+
};
|
44
34
|
return ModernRuntime2;
|
45
35
|
}();
|
46
36
|
var app_default = new ModernRuntime(global[MODERNJS_CONFIG_KEY] || {});
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
2
1
|
import { merge } from "@modern-js/utils/lodash";
|
3
2
|
class TestConfigOperator {
|
4
3
|
initial() {
|
@@ -43,12 +42,9 @@ class TestConfigOperator {
|
|
43
42
|
return this.jestConfig;
|
44
43
|
}
|
45
44
|
constructor(testConfig) {
|
46
|
-
|
47
|
-
_define_property(this, "_jestConfig", void 0);
|
48
|
-
_define_property(this, "userJestConfig", void 0);
|
49
|
-
_define_property(this, "defaultTestConfig", {
|
45
|
+
this.defaultTestConfig = {
|
50
46
|
transformer: "babel-jest"
|
51
|
-
}
|
47
|
+
};
|
52
48
|
this._testConfig = testConfig;
|
53
49
|
this._jestConfig = {};
|
54
50
|
this.userJestConfig = testConfig.jest;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
2
1
|
import { createApp } from "@modern-js/runtime";
|
3
2
|
import { MODERNJS_CONFIG_KEY } from "../constant";
|
4
3
|
import resolvePlugins from "./resolvePlugins";
|
@@ -28,7 +27,6 @@ class ModernRuntime {
|
|
28
27
|
})(Component);
|
29
28
|
}
|
30
29
|
constructor(options) {
|
31
|
-
_define_property(this, "options", void 0);
|
32
30
|
this.options = options;
|
33
31
|
}
|
34
32
|
}
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.48.
|
18
|
+
"version": "2.48.2",
|
19
19
|
"jsnext:source": "./src/cli/index.ts",
|
20
20
|
"types": "./dist/types/cli/index.d.ts",
|
21
21
|
"main": "./dist/cjs/cli/index.js",
|
@@ -116,7 +116,7 @@
|
|
116
116
|
"@modern-js-reduck/plugin-effects": "^1.1.10",
|
117
117
|
"@modern-js-reduck/plugin-immutable": "^1.1.10",
|
118
118
|
"@modern-js-reduck/store": "^1.1.10",
|
119
|
-
"@rsbuild/babel-preset": "0.4.
|
119
|
+
"@rsbuild/babel-preset": "0.4.15",
|
120
120
|
"@testing-library/jest-dom": "^5.16.1",
|
121
121
|
"@testing-library/react": "^13.4.0",
|
122
122
|
"@types/testing-library__jest-dom": "^5.14.3",
|
@@ -131,17 +131,17 @@
|
|
131
131
|
"ts-jest": "^29.1.0",
|
132
132
|
"yargs": "^17.0.1",
|
133
133
|
"@swc/helpers": "0.5.3",
|
134
|
-
"@modern-js/babel-compiler": "2.48.
|
135
|
-
"@modern-js/utils": "2.48.
|
136
|
-
"@modern-js/
|
137
|
-
"@modern-js/
|
138
|
-
"@modern-js/types": "2.48.
|
139
|
-
"@modern-js/bff-core": "2.48.
|
134
|
+
"@modern-js/babel-compiler": "2.48.2",
|
135
|
+
"@modern-js/utils": "2.48.2",
|
136
|
+
"@modern-js/plugin": "2.48.2",
|
137
|
+
"@modern-js/prod-server": "2.48.2",
|
138
|
+
"@modern-js/types": "2.48.2",
|
139
|
+
"@modern-js/bff-core": "2.48.2"
|
140
140
|
},
|
141
141
|
"peerDependencies": {
|
142
142
|
"react": ">=17",
|
143
143
|
"react-dom": ">=17",
|
144
|
-
"@modern-js/runtime": "^2.48.
|
144
|
+
"@modern-js/runtime": "^2.48.2"
|
145
145
|
},
|
146
146
|
"peerDependenciesMeta": {
|
147
147
|
"@modern-js/runtime": {
|
@@ -156,10 +156,10 @@
|
|
156
156
|
"@types/node": "^14",
|
157
157
|
"@types/yargs": "^17.0.2",
|
158
158
|
"typescript": "^5",
|
159
|
-
"@modern-js/core": "2.48.
|
160
|
-
"@modern-js/runtime": "2.48.
|
161
|
-
"@scripts/
|
162
|
-
"@scripts/
|
159
|
+
"@modern-js/core": "2.48.2",
|
160
|
+
"@modern-js/runtime": "2.48.2",
|
161
|
+
"@scripts/build": "2.48.2",
|
162
|
+
"@scripts/jest-config": "2.48.2"
|
163
163
|
},
|
164
164
|
"sideEffects": false,
|
165
165
|
"publishConfig": {
|