@modern-js/plugin-testing 1.5.2 → 1.5.5
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 +61 -0
- package/dist/js/modern/cli/index.js +1 -1
- package/dist/js/modern/runtime-testing/app.js +2 -1
- package/dist/js/node/cli/index.js +1 -1
- package/dist/js/node/runtime-testing/app.js +2 -1
- package/dist/js/treeshaking/cli/index.js +3 -8
- package/dist/js/treeshaking/cli/test.js +1 -5
- package/dist/js/treeshaking/runtime-testing/app.js +6 -13
- package/dist/js/treeshaking/runtime-testing/customRender.js +1 -6
- package/dist/js/treeshaking/runtime-testing/reduck.js +1 -6
- package/dist/js/treeshaking/runtime-testing/resolvePlugins.js +1 -6
- package/package.json +39 -17
- package/.eslintrc.js +0 -9
- package/jest.config.js +0 -7
- package/modern.config.js +0 -2
- package/tsconfig.json +0 -10
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,66 @@
|
|
1
1
|
# @modern-js/plugin-testing
|
2
2
|
|
3
|
+
## 1.5.5
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
|
8
|
+
- 1a30be07b: fix: remove some babel plugins that provided by @babel/preset-env
|
9
|
+
- Updated dependencies [d2995e7d7]
|
10
|
+
- Updated dependencies [47934c4da]
|
11
|
+
- Updated dependencies [273032b07]
|
12
|
+
- Updated dependencies [d32f35134]
|
13
|
+
- Updated dependencies [b1f7d2aa6]
|
14
|
+
- Updated dependencies [97086dde8]
|
15
|
+
- Updated dependencies [6ae4a34ae]
|
16
|
+
- Updated dependencies [97086dde8]
|
17
|
+
- Updated dependencies [97086dde8]
|
18
|
+
- Updated dependencies [b80229c79]
|
19
|
+
- Updated dependencies [ff6219909]
|
20
|
+
- Updated dependencies [948cc4436]
|
21
|
+
- @modern-js/webpack@1.7.0
|
22
|
+
- @modern-js/testing@1.5.2
|
23
|
+
- @modern-js/testing-plugin-bff@1.4.3
|
24
|
+
- @modern-js/runtime-core@1.4.6
|
25
|
+
- @modern-js/bff-utils@1.2.6
|
26
|
+
- @modern-js/babel-compiler@1.2.5
|
27
|
+
- @modern-js/utils@1.7.3
|
28
|
+
|
29
|
+
## 1.5.4
|
30
|
+
|
31
|
+
### Patch Changes
|
32
|
+
|
33
|
+
- 0e0537005: fix: unlock @babel/core version
|
34
|
+
- 69a728375: fix: remove exports.jsnext:source after publish
|
35
|
+
- Updated dependencies [b7b8075dc]
|
36
|
+
- Updated dependencies [cd7346b0d]
|
37
|
+
- Updated dependencies [0e0537005]
|
38
|
+
- Updated dependencies [738c55d39]
|
39
|
+
- Updated dependencies [69a728375]
|
40
|
+
- Updated dependencies [0f86e133b]
|
41
|
+
- @modern-js/webpack@1.6.2
|
42
|
+
- @modern-js/runtime-core@1.4.5
|
43
|
+
- @modern-js/utils@1.7.2
|
44
|
+
- @modern-js/testing@1.5.1
|
45
|
+
- @modern-js/babel-compiler@1.2.4
|
46
|
+
- @modern-js/testing-plugin-bff@1.4.2
|
47
|
+
- @modern-js/bff-utils@1.2.5
|
48
|
+
|
49
|
+
## 1.5.3
|
50
|
+
|
51
|
+
### Patch Changes
|
52
|
+
|
53
|
+
- 3f209269: feat(testing): add `afterTest` hook for testing plugin
|
54
|
+
- Updated dependencies [4697d1db]
|
55
|
+
- Updated dependencies [0ee4bb4e]
|
56
|
+
- Updated dependencies [6fa74d5f]
|
57
|
+
- Updated dependencies [3f209269]
|
58
|
+
- @modern-js/webpack@1.6.0
|
59
|
+
- @modern-js/testing@1.5.0
|
60
|
+
- @modern-js/utils@1.7.0
|
61
|
+
- @modern-js/runtime-core@1.4.4
|
62
|
+
- @modern-js/testing-plugin-bff@1.4.1
|
63
|
+
|
3
64
|
## 1.5.1
|
4
65
|
|
5
66
|
### Patch Changes
|
@@ -74,7 +74,7 @@ export default (() => {
|
|
74
74
|
testEnvironment: 'jsdom',
|
75
75
|
resolver: DEFAULT_RESOLVER_PATH,
|
76
76
|
rootDir: appContext.appDirectory || process.cwd(),
|
77
|
-
// todo:
|
77
|
+
// todo: diffrernt test root for diffrent solutions
|
78
78
|
// testMatch: [`<rootDir>/(src|tests|electron)/**/*.test.[jt]s?(x)`],
|
79
79
|
// testMatch bug on windows, issue: https://github.com/facebook/jest/issues/7914
|
80
80
|
testMatch: [`<rootDir>/src/**/*.test.[jt]s?(x)`, `<rootDir>/tests/**/*.test.[jt]s?(x)`, `<rootDir>/electron/**/*.test.[jt]s?(x)`]
|
@@ -94,7 +94,7 @@ var _default = () => {
|
|
94
94
|
testEnvironment: 'jsdom',
|
95
95
|
resolver: _testing.DEFAULT_RESOLVER_PATH,
|
96
96
|
rootDir: appContext.appDirectory || process.cwd(),
|
97
|
-
// todo:
|
97
|
+
// todo: diffrernt test root for diffrent solutions
|
98
98
|
// testMatch: [`<rootDir>/(src|tests|electron)/**/*.test.[jt]s?(x)`],
|
99
99
|
// testMatch bug on windows, issue: https://github.com/facebook/jest/issues/7914
|
100
100
|
testMatch: [`<rootDir>/src/**/*.test.[jt]s?(x)`, `<rootDir>/tests/**/*.test.[jt]s?(x)`, `<rootDir>/electron/**/*.test.[jt]s?(x)`]
|
@@ -1,11 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
|
5
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
6
|
-
|
7
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
8
|
-
|
9
4
|
import path from 'path';
|
10
5
|
import { PLUGIN_SCHEMAS, createRuntimeExportsUtils, isApiOnly } from '@modern-js/utils';
|
11
6
|
import { testingHooks, getModuleNameMapper, DEFAULT_RESOLVER_PATH } from '@modern-js/testing';
|
@@ -98,7 +93,7 @@ export default (function () {
|
|
98
93
|
testEnvironment: 'jsdom',
|
99
94
|
resolver: DEFAULT_RESOLVER_PATH,
|
100
95
|
rootDir: appContext.appDirectory || process.cwd(),
|
101
|
-
// todo:
|
96
|
+
// todo: diffrernt test root for diffrent solutions
|
102
97
|
// testMatch: [`<rootDir>/(src|tests|electron)/**/*.test.[jt]s?(x)`],
|
103
98
|
// testMatch bug on windows, issue: https://github.com/facebook/jest/issues/7914
|
104
99
|
testMatch: ["<rootDir>/src/**/*.test.[jt]s?(x)", "<rootDir>/tests/**/*.test.[jt]s?(x)", "<rootDir>/electron/**/*.test.[jt]s?(x)"]
|
@@ -1,9 +1,5 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
1
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
2
|
-
|
3
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
4
|
-
|
5
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
6
|
-
|
7
3
|
import path from 'path';
|
8
4
|
import { compiler } from '@modern-js/babel-compiler';
|
9
5
|
import { runTest } from '@modern-js/testing';
|
@@ -1,15 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
-
|
7
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8
|
-
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
10
|
-
|
11
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
12
|
-
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
13
5
|
import { createApp as _createApp } from '@modern-js/runtime-core';
|
14
6
|
import { MODERNJS_CONFIG_KEY } from "../constant";
|
15
7
|
import resolvePlugins from "./resolvePlugins";
|
@@ -18,7 +10,8 @@ var ModernRuntime = /*#__PURE__*/function () {
|
|
18
10
|
function ModernRuntime(options) {
|
19
11
|
_classCallCheck(this, ModernRuntime);
|
20
12
|
|
21
|
-
this
|
13
|
+
_defineProperty(this, "options", void 0);
|
14
|
+
|
22
15
|
this.options = options;
|
23
16
|
}
|
24
17
|
|
@@ -1,9 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
-
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
-
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
2
|
import React from 'react';
|
8
3
|
import { render } from '@testing-library/react';
|
9
4
|
import app from "./app";
|
@@ -1,9 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
-
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
-
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
2
|
import { createStore as originCreateStore } from '@modern-js-reduck/store';
|
8
3
|
import effectsPlugin from '@modern-js-reduck/plugin-effects';
|
9
4
|
import autoActionsPlugin from '@modern-js-reduck/plugin-auto-actions';
|
@@ -1,9 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
-
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
-
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
2
|
var allowedFeatures = ['router', 'state'];
|
8
3
|
export default function resolvePlugins(features) {
|
9
4
|
var plugins = [];
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "1.5.
|
14
|
+
"version": "1.5.5",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/types/index.d.ts",
|
17
17
|
"main": "./dist/js/node/index.js",
|
@@ -78,29 +78,29 @@
|
|
78
78
|
}
|
79
79
|
},
|
80
80
|
"dependencies": {
|
81
|
-
"@babel/core": "7.
|
82
|
-
"@babel/preset-env": "^7.
|
81
|
+
"@babel/core": "^7.17.0",
|
82
|
+
"@babel/preset-env": "^7.17.0",
|
83
83
|
"@babel/runtime": "^7",
|
84
84
|
"@modern-js-reduck/plugin-auto-actions": "^1.0.2",
|
85
85
|
"@modern-js-reduck/plugin-effects": "^1.0.2",
|
86
86
|
"@modern-js-reduck/plugin-immutable": "^1.0.1",
|
87
87
|
"@modern-js-reduck/store": "^1.0.3",
|
88
|
-
"@modern-js/babel-compiler": "^1.2.
|
89
|
-
"@modern-js/bff-utils": "^1.2.
|
90
|
-
"@modern-js/runtime-core": "^1.4.
|
91
|
-
"@modern-js/testing": "^1.
|
92
|
-
"@modern-js/testing-plugin-bff": "^1.4.
|
93
|
-
"@modern-js/utils": "^1.
|
94
|
-
"@modern-js/webpack": "^1.
|
88
|
+
"@modern-js/babel-compiler": "^1.2.5",
|
89
|
+
"@modern-js/bff-utils": "^1.2.6",
|
90
|
+
"@modern-js/runtime-core": "^1.4.6",
|
91
|
+
"@modern-js/testing": "^1.5.2",
|
92
|
+
"@modern-js/testing-plugin-bff": "^1.4.3",
|
93
|
+
"@modern-js/utils": "^1.7.3",
|
94
|
+
"@modern-js/webpack": "^1.7.0",
|
95
95
|
"@testing-library/jest-dom": "^5.14.1",
|
96
96
|
"@testing-library/react": "^12.0.0",
|
97
97
|
"@types/testing-library__jest-dom": "^5.14.3"
|
98
98
|
},
|
99
99
|
"devDependencies": {
|
100
|
-
"@modern-js/core": "1.
|
100
|
+
"@modern-js/core": "1.10.2",
|
101
101
|
"@scripts/build": "0.0.0",
|
102
102
|
"@scripts/jest-config": "0.0.0",
|
103
|
-
"@types/jest": "^
|
103
|
+
"@types/jest": "^27",
|
104
104
|
"@types/node": "^14",
|
105
105
|
"@types/react": "^17",
|
106
106
|
"@types/react-dom": "^17",
|
@@ -113,13 +113,35 @@
|
|
113
113
|
"modernConfig": {},
|
114
114
|
"publishConfig": {
|
115
115
|
"registry": "https://registry.npmjs.org/",
|
116
|
-
"access": "public"
|
117
|
-
|
116
|
+
"access": "public"
|
117
|
+
},
|
118
|
+
"wireit": {
|
119
|
+
"build": {
|
120
|
+
"command": "modern build",
|
121
|
+
"files": [
|
122
|
+
"src/**/*",
|
123
|
+
"tsconfig.json",
|
124
|
+
"package.json"
|
125
|
+
],
|
126
|
+
"output": [
|
127
|
+
"dist/**/*"
|
128
|
+
]
|
129
|
+
},
|
130
|
+
"test": {
|
131
|
+
"command": "jest --passWithNoTests",
|
132
|
+
"files": [
|
133
|
+
"src/**/*",
|
134
|
+
"tsconfig.json",
|
135
|
+
"package.json"
|
136
|
+
],
|
137
|
+
"output": []
|
138
|
+
}
|
118
139
|
},
|
119
140
|
"scripts": {
|
120
141
|
"new": "modern new",
|
121
142
|
"dev": "modern build --watch",
|
122
|
-
"build": "
|
123
|
-
"test": "
|
124
|
-
}
|
143
|
+
"build": "wireit",
|
144
|
+
"test": "wireit"
|
145
|
+
},
|
146
|
+
"readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
|
125
147
|
}
|
package/.eslintrc.js
DELETED
package/jest.config.js
DELETED
package/modern.config.js
DELETED