@modern-js/plugin-testing 0.0.0-next-20230202025108 → 0.0.0-next-20230203070739
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/CHANGELOG.md +7 -9
- package/dist/js/modern/modern-app.env.d.js +0 -0
- package/dist/js/node/modern-app.env.d.js +0 -0
- package/dist/js/treeshaking/base/config/transformer/babelTransformer.js +2 -2
- package/dist/js/treeshaking/base/runJest.js +2 -2
- package/dist/js/treeshaking/cli/bff/index.js +2 -2
- package/dist/js/treeshaking/cli/bff/mockAPI.js +1 -1
- package/dist/js/treeshaking/cli/bff/setup.js +2 -2
- package/dist/js/treeshaking/cli/test.js +3 -3
- package/dist/js/treeshaking/modern-app.env.d.js +1 -0
- package/dist/js/treeshaking/runtime-testing/app.js +5 -5
- package/dist/js/treeshaking/runtime-testing/reduck.js +2 -2
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
# @modern-js/plugin-testing
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-20230203070739
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies [fd5a3ed02]
|
|
8
|
-
- Updated dependencies [6ca1c0bb8]
|
|
9
|
-
- Updated dependencies [89b6739e5]
|
|
10
8
|
- Updated dependencies [b4dd017da]
|
|
11
|
-
- @modern-js/utils@0.0.0-next-
|
|
12
|
-
- @modern-js/runtime@0.0.0-next-
|
|
13
|
-
- @modern-js/babel-preset-app@0.0.0-next-
|
|
14
|
-
- @modern-js/prod-server@0.0.0-next-
|
|
15
|
-
- @modern-js/babel-compiler@0.0.0-next-
|
|
16
|
-
- @modern-js/plugin@0.0.0-next-
|
|
9
|
+
- @modern-js/utils@0.0.0-next-20230203070739
|
|
10
|
+
- @modern-js/runtime@0.0.0-next-20230203070739
|
|
11
|
+
- @modern-js/babel-preset-app@0.0.0-next-20230203070739
|
|
12
|
+
- @modern-js/prod-server@0.0.0-next-20230203070739
|
|
13
|
+
- @modern-js/babel-compiler@0.0.0-next-20230203070739
|
|
14
|
+
- @modern-js/plugin@0.0.0-next-20230203070739
|
|
17
15
|
|
|
18
16
|
## 2.2.0
|
|
19
17
|
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ref;
|
|
2
2
|
import babelJest from "babel-jest";
|
|
3
|
-
var babelTransformer = (
|
|
3
|
+
var babelTransformer = (ref = babelJest.createTransformer) === null || ref === void 0 ? void 0 : ref.call(babelJest, {
|
|
4
4
|
presets: [
|
|
5
5
|
[
|
|
6
6
|
require.resolve("@modern-js/babel-preset-app"),
|
|
@@ -186,7 +186,7 @@ function runJest(config) {
|
|
|
186
186
|
}
|
|
187
187
|
function _runJest() {
|
|
188
188
|
_runJest = _asyncToGenerator(function(config) {
|
|
189
|
-
var pwd, argvConfig,
|
|
189
|
+
var pwd, argvConfig, ref, results, globalConfig, e;
|
|
190
190
|
var _arguments = arguments;
|
|
191
191
|
return __generator(this, function(_state) {
|
|
192
192
|
switch(_state.label){
|
|
@@ -213,7 +213,7 @@ function _runJest() {
|
|
|
213
213
|
])
|
|
214
214
|
];
|
|
215
215
|
case 3:
|
|
216
|
-
|
|
216
|
+
ref = _state.sent(), results = ref.results, globalConfig = ref.globalConfig;
|
|
217
217
|
readResultsAndExit(results, globalConfig);
|
|
218
218
|
return [
|
|
219
219
|
3,
|
|
@@ -157,7 +157,7 @@ import { bff_info_key } from "./constant";
|
|
|
157
157
|
import { isBFFProject } from "./utils";
|
|
158
158
|
var setJestConfigForBFF = function() {
|
|
159
159
|
var _ref = _asyncToGenerator(function(param) {
|
|
160
|
-
var pwd, userConfig, plugins, routes, utils,
|
|
160
|
+
var pwd, userConfig, plugins, routes, utils, ref, bffConfig, jestConfig, alias, aliasMapper, moduleNameMapper, transform, apiOnly, mergedModuleNameMapper, resolver, configFields, commonConfig;
|
|
161
161
|
return __generator(this, function(_state) {
|
|
162
162
|
switch(_state.label){
|
|
163
163
|
case 0:
|
|
@@ -185,7 +185,7 @@ var setJestConfigForBFF = function() {
|
|
|
185
185
|
})
|
|
186
186
|
};
|
|
187
187
|
jestConfig = utils.jestConfig;
|
|
188
|
-
alias = (userConfig === null || userConfig === void 0 ? void 0 : (
|
|
188
|
+
alias = (userConfig === null || userConfig === void 0 ? void 0 : (ref = userConfig.source) === null || ref === void 0 ? void 0 : ref.alias) || {};
|
|
189
189
|
aliasMapper = getModuleNameMapper(alias);
|
|
190
190
|
moduleNameMapper = jestConfig.moduleNameMapper;
|
|
191
191
|
transform = {
|
|
@@ -142,7 +142,7 @@ var mockAPI_default = function(mockApiInfosByFile) {
|
|
|
142
142
|
var _info;
|
|
143
143
|
return (_info = info).handler.apply(_info, _toConsumableArray(args));
|
|
144
144
|
}
|
|
145
|
-
var
|
|
145
|
+
var ref = _slicedToArray(mock_getParamsAndPayload(args), 2), params = ref[0], payload = ref[1];
|
|
146
146
|
var returnHttp = module[info.name].returnHttp;
|
|
147
147
|
var url = mock_replaceUrlWithParams(info.routePath, params, payload.params);
|
|
148
148
|
var app = mockAppModule.getApp();
|
|
@@ -129,13 +129,13 @@ import mockAPI from "./mockAPI";
|
|
|
129
129
|
import { createApp, closeServer } from "./app";
|
|
130
130
|
var uped = false;
|
|
131
131
|
var setup = function() {
|
|
132
|
-
var
|
|
132
|
+
var ref, ref1;
|
|
133
133
|
if (uped) {
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
uped = true;
|
|
137
137
|
var bff_info = global[bff_info_key];
|
|
138
|
-
var prefix = bff_info === null || bff_info === void 0 ? void 0 : (
|
|
138
|
+
var prefix = bff_info === null || bff_info === void 0 ? void 0 : (ref = bff_info.modernUserConfig) === null || ref === void 0 ? void 0 : (ref1 = ref.bff) === null || ref1 === void 0 ? void 0 : ref1.prefix;
|
|
139
139
|
var apiRouter = new ApiRouter({
|
|
140
140
|
apiDir: path.join(bff_info.appDir, "./api"),
|
|
141
141
|
prefix: prefix
|
|
@@ -127,18 +127,18 @@ import { compiler } from "@modern-js/babel-compiler";
|
|
|
127
127
|
import { runTest } from "../base";
|
|
128
128
|
var test = function() {
|
|
129
129
|
var _ref = _asyncToGenerator(function(api) {
|
|
130
|
-
var
|
|
130
|
+
var ref, ref1, userConfig, appContext, jest, runtimeExportsPath;
|
|
131
131
|
return __generator(this, function(_state) {
|
|
132
132
|
switch(_state.label){
|
|
133
133
|
case 0:
|
|
134
134
|
userConfig = api.useResolvedConfigContext();
|
|
135
135
|
appContext = api.useAppContext();
|
|
136
136
|
userConfig.testing = userConfig.testing || {};
|
|
137
|
-
jest = userConfig.testing.jest || (userConfig === null || userConfig === void 0 ? void 0 : (
|
|
137
|
+
jest = userConfig.testing.jest || (userConfig === null || userConfig === void 0 ? void 0 : (ref = userConfig.tools) === null || ref === void 0 ? void 0 : ref.jest);
|
|
138
138
|
if (Array.isArray(jest)) {
|
|
139
139
|
userConfig.testing.jest = jest[0];
|
|
140
140
|
}
|
|
141
|
-
userConfig.testing.jest = userConfig.testing.jest || (userConfig === null || userConfig === void 0 ? void 0 : (
|
|
141
|
+
userConfig.testing.jest = userConfig.testing.jest || (userConfig === null || userConfig === void 0 ? void 0 : (ref1 = userConfig.tools) === null || ref1 === void 0 ? void 0 : ref1.jest);
|
|
142
142
|
runtimeExportsPath = path.join(appContext.internalDirectory, ".runtime-exports");
|
|
143
143
|
return [
|
|
144
144
|
4,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -65,12 +65,12 @@ var ModernRuntime = /*#__PURE__*/ function() {
|
|
|
65
65
|
{
|
|
66
66
|
key: "createApp",
|
|
67
67
|
value: function createApp1(props) {
|
|
68
|
-
var
|
|
69
|
-
var
|
|
70
|
-
var runtimeFeatures = (
|
|
68
|
+
var ref;
|
|
69
|
+
var ref1 = props || {}, entry = ref1.entry, children = ref1.children;
|
|
70
|
+
var runtimeFeatures = (ref = this.options) === null || ref === void 0 ? void 0 : ref.runtime;
|
|
71
71
|
if (entry) {
|
|
72
|
-
var
|
|
73
|
-
runtimeFeatures = _objectSpread({}, runtimeFeatures || {}, (
|
|
72
|
+
var ref2;
|
|
73
|
+
runtimeFeatures = _objectSpread({}, runtimeFeatures || {}, (ref2 = this.options.runtimeByEntries) === null || ref2 === void 0 ? void 0 : ref2[entry]);
|
|
74
74
|
}
|
|
75
75
|
var Component = function() {
|
|
76
76
|
if (!children) {
|
|
@@ -66,9 +66,9 @@ var autoActions = function() {
|
|
|
66
66
|
};
|
|
67
67
|
var createStore = function(props) {
|
|
68
68
|
var createStatePlugins = function() {
|
|
69
|
-
var
|
|
69
|
+
var ref;
|
|
70
70
|
var modernConfig = global[MODERNJS_CONFIG_KEY];
|
|
71
|
-
var stateConfig = modernConfig === null || modernConfig === void 0 ? void 0 : (
|
|
71
|
+
var stateConfig = modernConfig === null || modernConfig === void 0 ? void 0 : (ref = modernConfig.runtime) === null || ref === void 0 ? void 0 : ref.state;
|
|
72
72
|
var plugins = [];
|
|
73
73
|
if ((stateConfig === null || stateConfig === void 0 ? void 0 : stateConfig.effects) !== false) {
|
|
74
74
|
plugins.push(effects());
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.0-next-
|
|
14
|
+
"version": "0.0.0-next-20230203070739",
|
|
15
15
|
"jsnext:source": "./src/cli/index.ts",
|
|
16
16
|
"types": "./dist/types/cli/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/cli/index.js",
|
|
@@ -107,16 +107,16 @@
|
|
|
107
107
|
"jest": "^27.0.6",
|
|
108
108
|
"ts-jest": "^27.0.4",
|
|
109
109
|
"yargs": "^17.0.1",
|
|
110
|
-
"@modern-js/babel-compiler": "0.0.0-next-
|
|
111
|
-
"@modern-js/utils": "0.0.0-next-
|
|
112
|
-
"@modern-js/babel-preset-app": "0.0.0-next-
|
|
113
|
-
"@modern-js/plugin": "0.0.0-next-
|
|
114
|
-
"@modern-js/prod-server": "0.0.0-next-
|
|
110
|
+
"@modern-js/babel-compiler": "0.0.0-next-20230203070739",
|
|
111
|
+
"@modern-js/utils": "0.0.0-next-20230203070739",
|
|
112
|
+
"@modern-js/babel-preset-app": "0.0.0-next-20230203070739",
|
|
113
|
+
"@modern-js/plugin": "0.0.0-next-20230203070739",
|
|
114
|
+
"@modern-js/prod-server": "0.0.0-next-20230203070739"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"react": ">=17",
|
|
118
118
|
"react-dom": ">=17",
|
|
119
|
-
"@modern-js/runtime": "0.0.0-next-
|
|
119
|
+
"@modern-js/runtime": "0.0.0-next-20230203070739"
|
|
120
120
|
},
|
|
121
121
|
"peerDependenciesMeta": {
|
|
122
122
|
"@modern-js/runtime": {
|
|
@@ -133,12 +133,12 @@
|
|
|
133
133
|
"@jest/types": "^27.0.6",
|
|
134
134
|
"jest": "^27",
|
|
135
135
|
"typescript": "^4",
|
|
136
|
-
"@modern-js/core": "0.0.0-next-
|
|
137
|
-
"@modern-js/types": "0.0.0-next-
|
|
138
|
-
"@modern-js/
|
|
139
|
-
"@modern-js/
|
|
140
|
-
"@scripts/
|
|
141
|
-
"@scripts/
|
|
136
|
+
"@modern-js/core": "0.0.0-next-20230203070739",
|
|
137
|
+
"@modern-js/types": "0.0.0-next-20230203070739",
|
|
138
|
+
"@modern-js/runtime": "0.0.0-next-20230203070739",
|
|
139
|
+
"@modern-js/bff-core": "0.0.0-next-20230203070739",
|
|
140
|
+
"@scripts/build": "0.0.0-next-20230203070739",
|
|
141
|
+
"@scripts/jest-config": "0.0.0-next-20230203070739"
|
|
142
142
|
},
|
|
143
143
|
"sideEffects": false,
|
|
144
144
|
"modernConfig": {},
|