@modern-js/plugin-testing 2.15.0 → 2.17.0

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