@modern-js/plugin-testing 2.14.0 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +32 -0
- package/dist/cjs/base/config/index.js +15 -39
- package/dist/cjs/base/config/patches/assetsModule.js +7 -35
- package/dist/cjs/base/config/patches/filemock.js +8 -24
- package/dist/cjs/base/config/patches/index.js +13 -28
- package/dist/cjs/base/config/patches/transformer.js +13 -38
- package/dist/cjs/base/config/resolver.js +23 -26
- package/dist/cjs/base/config/testConfigOperator.js +39 -38
- package/dist/cjs/base/config/transformer/babelTransformer.js +16 -37
- package/dist/cjs/base/hook.js +17 -31
- package/dist/cjs/base/index.js +36 -41
- package/dist/cjs/base/runJest.js +31 -57
- package/dist/cjs/base/types/index.js +4 -15
- package/dist/cjs/base/utils.js +30 -53
- package/dist/cjs/cli/bff/app.js +17 -32
- package/dist/cjs/cli/bff/constant.js +7 -25
- package/dist/cjs/cli/bff/index.js +71 -92
- package/dist/cjs/cli/bff/mockAPI.js +115 -92
- package/dist/cjs/cli/bff/setup.js +30 -51
- package/dist/cjs/cli/bff/utils/index.js +21 -45
- package/dist/cjs/cli/index.js +43 -59
- package/dist/cjs/cli/test.js +35 -62
- package/dist/cjs/constant.js +7 -25
- package/dist/cjs/index.js +20 -19
- package/dist/cjs/runtime-testing/app.js +40 -45
- package/dist/cjs/runtime-testing/base.js +34 -40
- package/dist/cjs/runtime-testing/customRender.js +21 -39
- package/dist/cjs/runtime-testing/index.js +19 -18
- package/dist/cjs/runtime-testing/reduck.js +35 -55
- package/dist/cjs/runtime-testing/request.js +16 -39
- package/dist/cjs/runtime-testing/resolvePlugins.js +12 -25
- package/dist/esm/base/config/index.js +146 -139
- package/dist/esm/base/config/patches/assetsModule.js +7 -8
- package/dist/esm/base/config/patches/filemock.js +1 -2
- package/dist/esm/base/config/patches/index.js +214 -207
- package/dist/esm/base/config/patches/transformer.js +27 -28
- package/dist/esm/base/config/resolver.js +22 -35
- package/dist/esm/base/config/testConfigOperator.js +119 -116
- package/dist/esm/base/config/transformer/babelTransformer.js +12 -13
- package/dist/esm/base/hook.js +5 -6
- package/dist/esm/base/index.js +5 -6
- package/dist/esm/base/runJest.js +270 -264
- package/dist/esm/base/types/index.js +1 -1
- package/dist/esm/base/utils.js +66 -67
- package/dist/esm/cli/bff/app.js +187 -179
- package/dist/esm/cli/bff/constant.js +1 -2
- package/dist/esm/cli/bff/index.js +285 -278
- package/dist/esm/cli/bff/mockAPI.js +177 -163
- package/dist/esm/cli/bff/setup.js +182 -174
- package/dist/esm/cli/bff/utils/index.js +40 -41
- package/dist/esm/cli/index.js +249 -242
- package/dist/esm/cli/test.js +172 -166
- package/dist/esm/constant.js +1 -2
- package/dist/esm/runtime-testing/app.js +79 -77
- package/dist/esm/runtime-testing/base.js +2 -3
- package/dist/esm/runtime-testing/customRender.js +30 -31
- package/dist/esm/runtime-testing/reduck.js +72 -73
- package/dist/esm/runtime-testing/request.js +55 -45
- package/dist/esm/runtime-testing/resolvePlugins.js +38 -39
- package/dist/esm-node/base/config/index.js +2 -6
- package/dist/esm-node/base/config/patches/assetsModule.js +1 -4
- package/dist/esm-node/base/config/patches/filemock.js +1 -4
- package/dist/esm-node/base/config/patches/index.js +5 -5
- package/dist/esm-node/base/config/patches/transformer.js +5 -5
- package/dist/esm-node/base/config/resolver.js +20 -19
- package/dist/esm-node/base/config/testConfigOperator.js +30 -13
- package/dist/esm-node/base/config/transformer/babelTransformer.js +3 -6
- package/dist/esm-node/base/hook.js +3 -8
- package/dist/esm-node/base/index.js +5 -13
- package/dist/esm-node/base/runJest.js +8 -20
- package/dist/esm-node/base/types/index.js +1 -0
- package/dist/esm-node/base/utils.js +8 -17
- package/dist/esm-node/cli/bff/app.js +2 -7
- package/dist/esm-node/cli/bff/constant.js +1 -4
- package/dist/esm-node/cli/bff/index.js +43 -54
- package/dist/esm-node/cli/bff/mockAPI.js +65 -59
- package/dist/esm-node/cli/bff/setup.js +11 -19
- package/dist/esm-node/cli/bff/utils/index.js +6 -10
- package/dist/esm-node/cli/index.js +11 -23
- package/dist/esm-node/cli/test.js +19 -28
- package/dist/esm-node/constant.js +1 -4
- package/dist/esm-node/runtime-testing/app.js +22 -10
- package/dist/esm-node/runtime-testing/base.js +2 -6
- package/dist/esm-node/runtime-testing/customRender.js +5 -5
- package/dist/esm-node/runtime-testing/reduck.js +10 -16
- package/dist/esm-node/runtime-testing/request.js +1 -3
- package/dist/esm-node/runtime-testing/resolvePlugins.js +6 -6
- package/package.json +18 -14
package/dist/esm/cli/test.js
CHANGED
@@ -1,180 +1,186 @@
|
|
1
1
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
try {
|
3
|
+
var info = gen[key](arg);
|
4
|
+
var value = info.value;
|
5
|
+
} catch (error) {
|
6
|
+
reject(error);
|
7
|
+
return;
|
8
|
+
}
|
9
|
+
if (info.done) {
|
10
|
+
resolve(value);
|
11
|
+
} else {
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
13
|
+
}
|
14
14
|
}
|
15
|
-
function
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
15
|
+
function _async_to_generator(fn) {
|
16
|
+
return function() {
|
17
|
+
var self = this, args = arguments;
|
18
|
+
return new Promise(function(resolve, reject) {
|
19
|
+
var gen = fn.apply(self, args);
|
20
|
+
function _next(value) {
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
22
|
+
}
|
23
|
+
function _throw(err) {
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
25
|
+
}
|
26
|
+
_next(void 0);
|
27
|
+
});
|
28
|
+
};
|
29
29
|
}
|
30
|
-
var __generator =
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
30
|
+
var __generator = function(thisArg, body) {
|
31
|
+
var f, y, t, g, _ = {
|
32
|
+
label: 0,
|
33
|
+
sent: function() {
|
34
|
+
if (t[0] & 1)
|
35
|
+
throw t[1];
|
36
|
+
return t[1];
|
37
|
+
},
|
38
|
+
trys: [],
|
39
|
+
ops: []
|
40
|
+
};
|
41
|
+
return g = {
|
42
|
+
next: verb(0),
|
43
|
+
"throw": verb(1),
|
44
|
+
"return": verb(2)
|
45
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
46
|
+
return this;
|
47
|
+
}), g;
|
48
|
+
function verb(n) {
|
49
|
+
return function(v) {
|
50
|
+
return step([
|
51
|
+
n,
|
52
|
+
v
|
53
|
+
]);
|
39
54
|
};
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
break;
|
68
|
-
case 4:
|
69
|
-
_.label++;
|
70
|
-
return {
|
71
|
-
value: op[1],
|
72
|
-
done: false
|
73
|
-
};
|
74
|
-
case 5:
|
75
|
-
_.label++;
|
76
|
-
y = op[1];
|
77
|
-
op = [
|
78
|
-
0
|
79
|
-
];
|
80
|
-
continue;
|
81
|
-
case 7:
|
82
|
-
op = _.ops.pop();
|
83
|
-
_.trys.pop();
|
84
|
-
continue;
|
85
|
-
default:
|
86
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
87
|
-
_ = 0;
|
88
|
-
continue;
|
89
|
-
}
|
90
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
91
|
-
_.label = op[1];
|
92
|
-
break;
|
93
|
-
}
|
94
|
-
if (op[0] === 6 && _.label < t[1]) {
|
95
|
-
_.label = t[1];
|
96
|
-
t = op;
|
97
|
-
break;
|
98
|
-
}
|
99
|
-
if (t && _.label < t[2]) {
|
100
|
-
_.label = t[2];
|
101
|
-
_.ops.push(op);
|
102
|
-
break;
|
103
|
-
}
|
104
|
-
if (t[2]) _.ops.pop();
|
105
|
-
_.trys.pop();
|
106
|
-
continue;
|
107
|
-
}
|
108
|
-
op = body.call(thisArg, _);
|
109
|
-
} catch (e) {
|
55
|
+
}
|
56
|
+
function step(op) {
|
57
|
+
if (f)
|
58
|
+
throw new TypeError("Generator is already executing.");
|
59
|
+
while (_)
|
60
|
+
try {
|
61
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
62
|
+
return t;
|
63
|
+
if (y = 0, t)
|
64
|
+
op = [
|
65
|
+
op[0] & 2,
|
66
|
+
t.value
|
67
|
+
];
|
68
|
+
switch (op[0]) {
|
69
|
+
case 0:
|
70
|
+
case 1:
|
71
|
+
t = op;
|
72
|
+
break;
|
73
|
+
case 4:
|
74
|
+
_.label++;
|
75
|
+
return {
|
76
|
+
value: op[1],
|
77
|
+
done: false
|
78
|
+
};
|
79
|
+
case 5:
|
80
|
+
_.label++;
|
81
|
+
y = op[1];
|
110
82
|
op = [
|
111
|
-
|
112
|
-
e
|
83
|
+
0
|
113
84
|
];
|
114
|
-
|
115
|
-
|
116
|
-
|
85
|
+
continue;
|
86
|
+
case 7:
|
87
|
+
op = _.ops.pop();
|
88
|
+
_.trys.pop();
|
89
|
+
continue;
|
90
|
+
default:
|
91
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
92
|
+
_ = 0;
|
93
|
+
continue;
|
94
|
+
}
|
95
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
96
|
+
_.label = op[1];
|
97
|
+
break;
|
98
|
+
}
|
99
|
+
if (op[0] === 6 && _.label < t[1]) {
|
100
|
+
_.label = t[1];
|
101
|
+
t = op;
|
102
|
+
break;
|
103
|
+
}
|
104
|
+
if (t && _.label < t[2]) {
|
105
|
+
_.label = t[2];
|
106
|
+
_.ops.push(op);
|
107
|
+
break;
|
108
|
+
}
|
109
|
+
if (t[2])
|
110
|
+
_.ops.pop();
|
111
|
+
_.trys.pop();
|
112
|
+
continue;
|
117
113
|
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
114
|
+
op = body.call(thisArg, _);
|
115
|
+
} catch (e) {
|
116
|
+
op = [
|
117
|
+
6,
|
118
|
+
e
|
119
|
+
];
|
120
|
+
y = 0;
|
121
|
+
} finally {
|
122
|
+
f = t = 0;
|
123
|
+
}
|
124
|
+
if (op[0] & 5)
|
125
|
+
throw op[1];
|
126
|
+
return {
|
127
|
+
value: op[0] ? op[1] : void 0,
|
128
|
+
done: true
|
129
|
+
};
|
130
|
+
}
|
124
131
|
};
|
125
132
|
import path from "path";
|
126
133
|
import { compiler } from "@modern-js/babel-compiler";
|
127
134
|
import { runTest } from "../base";
|
128
135
|
var test = function() {
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
});
|
136
|
+
var _ref = _async_to_generator(function(api) {
|
137
|
+
var _userConfig_tools, _userConfig_tools1, userConfig, appContext, jest, runtimeExportsPath;
|
138
|
+
return __generator(this, function(_state) {
|
139
|
+
switch (_state.label) {
|
140
|
+
case 0:
|
141
|
+
userConfig = api.useResolvedConfigContext();
|
142
|
+
appContext = api.useAppContext();
|
143
|
+
userConfig.testing = userConfig.testing || {};
|
144
|
+
jest = userConfig.testing.jest || (userConfig === null || userConfig === void 0 ? void 0 : (_userConfig_tools = userConfig.tools) === null || _userConfig_tools === void 0 ? void 0 : _userConfig_tools.jest);
|
145
|
+
if (Array.isArray(jest)) {
|
146
|
+
userConfig.testing.jest = jest[0];
|
147
|
+
}
|
148
|
+
userConfig.testing.jest = userConfig.testing.jest || (userConfig === null || userConfig === void 0 ? void 0 : (_userConfig_tools1 = userConfig.tools) === null || _userConfig_tools1 === void 0 ? void 0 : _userConfig_tools1.jest);
|
149
|
+
runtimeExportsPath = path.join(appContext.internalDirectory, ".runtime-exports");
|
150
|
+
return [
|
151
|
+
4,
|
152
|
+
compiler({
|
153
|
+
sourceDir: runtimeExportsPath,
|
154
|
+
rootDir: runtimeExportsPath,
|
155
|
+
distDir: runtimeExportsPath,
|
156
|
+
quiet: true
|
157
|
+
}, {
|
158
|
+
presets: [
|
159
|
+
[
|
160
|
+
require.resolve("@babel/preset-env"),
|
161
|
+
{
|
162
|
+
modules: "cjs"
|
163
|
+
}
|
164
|
+
]
|
165
|
+
]
|
166
|
+
})
|
167
|
+
];
|
168
|
+
case 1:
|
169
|
+
_state.sent();
|
170
|
+
return [
|
171
|
+
4,
|
172
|
+
runTest(api, userConfig.testing)
|
173
|
+
];
|
174
|
+
case 2:
|
175
|
+
_state.sent();
|
176
|
+
return [
|
177
|
+
2
|
178
|
+
];
|
179
|
+
}
|
174
180
|
});
|
175
|
-
|
176
|
-
|
177
|
-
|
181
|
+
});
|
182
|
+
return function test2(api) {
|
183
|
+
return _ref.apply(this, arguments);
|
184
|
+
};
|
178
185
|
}();
|
179
|
-
|
180
|
-
export { test_default as default };
|
186
|
+
export default test;
|
package/dist/esm/constant.js
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
var MODERNJS_CONFIG_KEY = "__modernjs_config__";
|
2
|
-
export { MODERNJS_CONFIG_KEY };
|
1
|
+
export var MODERNJS_CONFIG_KEY = "__modernjs_config__";
|
@@ -1,90 +1,92 @@
|
|
1
|
-
function
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
function _class_call_check(instance, Constructor) {
|
2
|
+
if (!(instance instanceof Constructor)) {
|
3
|
+
throw new TypeError("Cannot call a class as a function");
|
4
|
+
}
|
5
5
|
}
|
6
6
|
function _defineProperties(target, props) {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
for (var i = 0; i < props.length; i++) {
|
8
|
+
var descriptor = props[i];
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
10
|
+
descriptor.configurable = true;
|
11
|
+
if ("value" in descriptor)
|
12
|
+
descriptor.writable = true;
|
13
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
14
|
+
}
|
14
15
|
}
|
15
|
-
function
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
17
|
+
if (protoProps)
|
18
|
+
_defineProperties(Constructor.prototype, protoProps);
|
19
|
+
if (staticProps)
|
20
|
+
_defineProperties(Constructor, staticProps);
|
21
|
+
return Constructor;
|
19
22
|
}
|
20
|
-
function
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
23
|
+
function _define_property(obj, key, value) {
|
24
|
+
if (key in obj) {
|
25
|
+
Object.defineProperty(obj, key, {
|
26
|
+
value,
|
27
|
+
enumerable: true,
|
28
|
+
configurable: true,
|
29
|
+
writable: true
|
30
|
+
});
|
31
|
+
} else {
|
32
|
+
obj[key] = value;
|
33
|
+
}
|
34
|
+
return obj;
|
32
35
|
}
|
33
|
-
function
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
ownKeys.forEach(function(key) {
|
43
|
-
_defineProperty(target, key, source[key]);
|
44
|
-
});
|
36
|
+
function _object_spread(target) {
|
37
|
+
for (var i = 1; i < arguments.length; i++) {
|
38
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
39
|
+
var ownKeys = Object.keys(source);
|
40
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
41
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
42
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
43
|
+
}));
|
45
44
|
}
|
46
|
-
|
45
|
+
ownKeys.forEach(function(key) {
|
46
|
+
_define_property(target, key, source[key]);
|
47
|
+
});
|
48
|
+
}
|
49
|
+
return target;
|
47
50
|
}
|
48
51
|
import { createApp } from "@modern-js/runtime";
|
49
52
|
import { MODERNJS_CONFIG_KEY } from "../constant";
|
50
53
|
import resolvePlugins from "./resolvePlugins";
|
51
|
-
var ModernRuntime =
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
var ModernRuntime = /* @__PURE__ */ function() {
|
55
|
+
"use strict";
|
56
|
+
function ModernRuntime2(options) {
|
57
|
+
_class_call_check(this, ModernRuntime2);
|
58
|
+
_define_property(this, "options", void 0);
|
59
|
+
this.options = options;
|
60
|
+
}
|
61
|
+
_create_class(ModernRuntime2, [
|
62
|
+
{
|
63
|
+
key: "init",
|
64
|
+
value: function init(options) {
|
56
65
|
this.options = options;
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
{
|
66
|
-
|
67
|
-
|
68
|
-
var _this_options;
|
69
|
-
var _ref = props || {}, entry = _ref.entry, children = _ref.children;
|
70
|
-
var runtimeFeatures = (_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.runtime;
|
71
|
-
if (entry) {
|
72
|
-
var _this_options_runtimeByEntries;
|
73
|
-
runtimeFeatures = _objectSpread({}, runtimeFeatures || {}, (_this_options_runtimeByEntries = this.options.runtimeByEntries) === null || _this_options_runtimeByEntries === void 0 ? void 0 : _this_options_runtimeByEntries[entry]);
|
74
|
-
}
|
75
|
-
var Component = function() {
|
76
|
-
if (!children) {
|
77
|
-
return null;
|
78
|
-
}
|
79
|
-
return children;
|
80
|
-
};
|
81
|
-
return createApp({
|
82
|
-
plugins: resolvePlugins(runtimeFeatures || {})
|
83
|
-
})(Component);
|
84
|
-
}
|
66
|
+
}
|
67
|
+
},
|
68
|
+
{
|
69
|
+
key: "createApp",
|
70
|
+
value: function createApp1(props) {
|
71
|
+
var _this_options;
|
72
|
+
var _ref = props || {}, entry = _ref.entry, children = _ref.children;
|
73
|
+
var runtimeFeatures = (_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.runtime;
|
74
|
+
if (entry) {
|
75
|
+
var _this_options_runtimeByEntries;
|
76
|
+
runtimeFeatures = _object_spread({}, runtimeFeatures || {}, (_this_options_runtimeByEntries = this.options.runtimeByEntries) === null || _this_options_runtimeByEntries === void 0 ? void 0 : _this_options_runtimeByEntries[entry]);
|
85
77
|
}
|
86
|
-
|
87
|
-
|
78
|
+
var Component = function() {
|
79
|
+
if (!children) {
|
80
|
+
return null;
|
81
|
+
}
|
82
|
+
return children;
|
83
|
+
};
|
84
|
+
return createApp({
|
85
|
+
plugins: resolvePlugins(runtimeFeatures || {})
|
86
|
+
})(Component);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
]);
|
90
|
+
return ModernRuntime2;
|
88
91
|
}();
|
89
|
-
|
90
|
-
export { app_default as default };
|
92
|
+
export default new ModernRuntime(global[MODERNJS_CONFIG_KEY] || {});
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
1
|
+
export { default as renderApp } from "./customRender";
|
2
2
|
export * from "@testing-library/react";
|
3
|
-
|
4
|
-
export { default2 as renderApp, request as testBff };
|
3
|
+
export { request as testBff } from "./request";
|
@@ -1,41 +1,40 @@
|
|
1
|
-
function
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
function _define_property(obj, key, value) {
|
2
|
+
if (key in obj) {
|
3
|
+
Object.defineProperty(obj, key, {
|
4
|
+
value,
|
5
|
+
enumerable: true,
|
6
|
+
configurable: true,
|
7
|
+
writable: true
|
8
|
+
});
|
9
|
+
} else {
|
10
|
+
obj[key] = value;
|
11
|
+
}
|
12
|
+
return obj;
|
13
13
|
}
|
14
|
-
function
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
ownKeys.forEach(function(key) {
|
24
|
-
_defineProperty(target, key, source[key]);
|
25
|
-
});
|
14
|
+
function _object_spread(target) {
|
15
|
+
for (var i = 1; i < arguments.length; i++) {
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
17
|
+
var ownKeys = Object.keys(source);
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
21
|
+
}));
|
26
22
|
}
|
27
|
-
|
23
|
+
ownKeys.forEach(function(key) {
|
24
|
+
_define_property(target, key, source[key]);
|
25
|
+
});
|
26
|
+
}
|
27
|
+
return target;
|
28
28
|
}
|
29
29
|
import React from "react";
|
30
30
|
import { render } from "@testing-library/react";
|
31
31
|
import app from "./app";
|
32
32
|
var WrapModernProviders = function(props) {
|
33
|
-
|
33
|
+
return React.createElement(app.createApp(props));
|
34
34
|
};
|
35
35
|
var customRender = function(ui, options) {
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
return render(ui, _object_spread({
|
37
|
+
wrapper: WrapModernProviders
|
38
|
+
}, options));
|
39
39
|
};
|
40
|
-
|
41
|
-
export { customRender_default as default };
|
40
|
+
export default customRender;
|