@modern-js/plugin-testing 1.0.0-rc.15 → 1.0.0-rc.16
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 +17 -0
- package/dist/js/modern/cli/index.js +1 -2
- package/dist/js/modern/cli/plugins/modern.js +3 -2
- package/dist/js/modern/cli/test.js +3 -2
- package/dist/js/node/cli/index.js +2 -4
- package/dist/js/node/cli/plugins/modern.js +3 -5
- package/dist/js/node/cli/test.js +3 -3
- package/dist/js/treeshaking/cli/index.js +1 -2
- package/dist/js/treeshaking/cli/plugins/modern.js +3 -2
- package/dist/js/treeshaking/cli/test.js +3 -2
- package/package.json +11 -11
- package/src/cli/index.ts +5 -2
- package/src/cli/plugins/modern.ts +3 -2
- package/src/cli/test.ts +3 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# @modern-js/plugin-testing
|
2
2
|
|
3
|
+
## 1.0.0-rc.16
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 224f7fe: fix server route match
|
8
|
+
- 30ac27c: feat: add generator package description
|
9
|
+
- 204c626: feat: initial
|
10
|
+
- Updated dependencies [224f7fe]
|
11
|
+
- Updated dependencies [30ac27c]
|
12
|
+
- Updated dependencies [204c626]
|
13
|
+
- @modern-js/core@1.0.0-rc.16
|
14
|
+
- @modern-js/webpack@1.0.0-rc.16
|
15
|
+
- @modern-js/testing@1.0.0-rc.16
|
16
|
+
- @modern-js/runtime-core@1.0.0-rc.16
|
17
|
+
- @modern-js/babel-compiler@1.0.0-rc.16
|
18
|
+
- @modern-js/utils@1.0.0-rc.16
|
19
|
+
|
3
20
|
## 1.0.0-rc.15
|
4
21
|
|
5
22
|
### Patch Changes
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import path from '
|
1
|
+
import { path, createRuntimeExportsUtils, PLUGIN_SCHEMAS } from '@modern-js/utils';
|
2
2
|
import { createPlugin, useAppContext } from '@modern-js/core';
|
3
|
-
import { createRuntimeExportsUtils, PLUGIN_SCHEMAS } from '@modern-js/utils';
|
4
3
|
import test from "./test";
|
5
4
|
export default createPlugin(() => {
|
6
5
|
let testingExportsUtils;
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import path from '
|
1
|
+
import { path } from '@modern-js/utils';
|
2
2
|
import { createPlugin } from '@modern-js/testing';
|
3
3
|
import { modernjs_config_key } from "../../constant";
|
4
|
+
import { upath } from '@modern-js/utils';
|
4
5
|
|
5
6
|
const getModuleNameMapper = config => {
|
6
7
|
const {
|
@@ -36,7 +37,7 @@ export default ((webpackConfig, userConfig, pwd) => createPlugin(() => ({
|
|
36
37
|
},
|
37
38
|
moduleNameMapper: getModuleNameMapper(webpackConfig),
|
38
39
|
testEnvironment: 'jsdom',
|
39
|
-
resolver: require.resolve("../resolver")
|
40
|
+
resolver: upath.normalizeSafe(require.resolve("../resolver"))
|
40
41
|
});
|
41
42
|
utils.setJestConfig({
|
42
43
|
// todo: diffrent test root for diffrent solutions
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import path from '
|
1
|
+
import { path } from '@modern-js/utils';
|
2
2
|
import { compiler } from '@modern-js/babel-compiler';
|
3
|
+
import { upath } from '@modern-js/utils';
|
3
4
|
import { useAppContext, useResolvedConfigContext } from '@modern-js/core';
|
4
5
|
import { runTest } from '@modern-js/testing';
|
5
6
|
import { getWebpackConfig, WebpackConfigTarget } from '@modern-js/webpack'; // import testingBffPlugin from '@modern-js/testing-plugin-bff';
|
@@ -29,7 +30,7 @@ const test = async () => {
|
|
29
30
|
distDir: runtimeExportsPath,
|
30
31
|
quiet: true
|
31
32
|
}, {
|
32
|
-
presets: [[require.resolve('@babel/preset-env'), {
|
33
|
+
presets: [[upath.normalizeSafe(require.resolve('@babel/preset-env')), {
|
33
34
|
modules: 'cjs'
|
34
35
|
}]]
|
35
36
|
});
|
@@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _utils = require("@modern-js/utils");
|
9
9
|
|
10
10
|
var _core = require("@modern-js/core");
|
11
11
|
|
12
|
-
var _utils = require("@modern-js/utils");
|
13
|
-
|
14
12
|
var _test = _interopRequireDefault(require("./test"));
|
15
13
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -44,7 +42,7 @@ var _default = (0, _core.createPlugin)(() => {
|
|
44
42
|
},
|
45
43
|
|
46
44
|
addRuntimeExports() {
|
47
|
-
const testingPath =
|
45
|
+
const testingPath = _utils.path.resolve(__dirname, '../');
|
48
46
|
|
49
47
|
testingExportsUtils.addExport(`export * from '${testingPath}'`);
|
50
48
|
}
|
@@ -5,14 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _utils = require("@modern-js/utils");
|
9
9
|
|
10
10
|
var _testing = require("@modern-js/testing");
|
11
11
|
|
12
12
|
var _constant = require("../../constant");
|
13
13
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
14
|
const getModuleNameMapper = config => {
|
17
15
|
const {
|
18
16
|
resolve: {
|
@@ -34,7 +32,7 @@ const getModuleNameMapper = config => {
|
|
34
32
|
|
35
33
|
const key = `^${cur}/(.*)$`;
|
36
34
|
|
37
|
-
const value =
|
35
|
+
const value = _utils.path.normalize(`${aliasValue}/$1`);
|
38
36
|
|
39
37
|
memo[key] = value;
|
40
38
|
return memo;
|
@@ -49,7 +47,7 @@ var _default = (webpackConfig, userConfig, pwd) => (0, _testing.createPlugin)(()
|
|
49
47
|
},
|
50
48
|
moduleNameMapper: getModuleNameMapper(webpackConfig),
|
51
49
|
testEnvironment: 'jsdom',
|
52
|
-
resolver: require.resolve("../resolver")
|
50
|
+
resolver: _utils.upath.normalizeSafe(require.resolve("../resolver"))
|
53
51
|
});
|
54
52
|
utils.setJestConfig({
|
55
53
|
// todo: diffrent test root for diffrent solutions
|
package/dist/js/node/cli/test.js
CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _utils = require("@modern-js/utils");
|
9
9
|
|
10
10
|
var _babelCompiler = require("@modern-js/babel-compiler");
|
11
11
|
|
@@ -37,7 +37,7 @@ const test = async () => {
|
|
37
37
|
// }),
|
38
38
|
];
|
39
39
|
|
40
|
-
const runtimeExportsPath =
|
40
|
+
const runtimeExportsPath = _utils.path.join(config.internalDirectory, '.runtime-exports');
|
41
41
|
|
42
42
|
await (0, _babelCompiler.compiler)({
|
43
43
|
sourceDir: runtimeExportsPath,
|
@@ -45,7 +45,7 @@ const test = async () => {
|
|
45
45
|
distDir: runtimeExportsPath,
|
46
46
|
quiet: true
|
47
47
|
}, {
|
48
|
-
presets: [[require.resolve('@babel/preset-env'), {
|
48
|
+
presets: [[_utils.upath.normalizeSafe(require.resolve('@babel/preset-env')), {
|
49
49
|
modules: 'cjs'
|
50
50
|
}]]
|
51
51
|
});
|
@@ -4,9 +4,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
4
4
|
|
5
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
6
|
|
7
|
-
import path from '
|
7
|
+
import { path, createRuntimeExportsUtils, PLUGIN_SCHEMAS } from '@modern-js/utils';
|
8
8
|
import { createPlugin, useAppContext } from '@modern-js/core';
|
9
|
-
import { createRuntimeExportsUtils, PLUGIN_SCHEMAS } from '@modern-js/utils';
|
10
9
|
import test from "./test";
|
11
10
|
export default createPlugin(function () {
|
12
11
|
var testingExportsUtils;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
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; }
|
2
2
|
|
3
|
-
import path from '
|
3
|
+
import { path } from '@modern-js/utils';
|
4
4
|
import { createPlugin } from '@modern-js/testing';
|
5
5
|
import { modernjs_config_key } from "../../constant";
|
6
|
+
import { upath } from '@modern-js/utils';
|
6
7
|
|
7
8
|
var getModuleNameMapper = function getModuleNameMapper(config) {
|
8
9
|
var _config$resolve$alias = config.resolve.alias,
|
@@ -37,7 +38,7 @@ export default (function (webpackConfig, userConfig, pwd) {
|
|
37
38
|
globals: _defineProperty({}, modernjs_config_key, userConfig),
|
38
39
|
moduleNameMapper: getModuleNameMapper(webpackConfig),
|
39
40
|
testEnvironment: 'jsdom',
|
40
|
-
resolver: require.resolve("../resolver")
|
41
|
+
resolver: upath.normalizeSafe(require.resolve("../resolver"))
|
41
42
|
});
|
42
43
|
utils.setJestConfig({
|
43
44
|
// todo: diffrent test root for diffrent solutions
|
@@ -16,8 +16,9 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
16
16
|
|
17
17
|
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); }); }; }
|
18
18
|
|
19
|
-
import path from '
|
19
|
+
import { path } from '@modern-js/utils';
|
20
20
|
import { compiler } from '@modern-js/babel-compiler';
|
21
|
+
import { upath } from '@modern-js/utils';
|
21
22
|
import { useAppContext, useResolvedConfigContext } from '@modern-js/core';
|
22
23
|
import { runTest } from '@modern-js/testing';
|
23
24
|
import { getWebpackConfig, WebpackConfigTarget } from '@modern-js/webpack'; // import testingBffPlugin from '@modern-js/testing-plugin-bff';
|
@@ -54,7 +55,7 @@ var test = /*#__PURE__*/function () {
|
|
54
55
|
distDir: runtimeExportsPath,
|
55
56
|
quiet: true
|
56
57
|
}, {
|
57
|
-
presets: [[require.resolve('@babel/preset-env'), {
|
58
|
+
presets: [[upath.normalizeSafe(require.resolve('@babel/preset-env')), {
|
58
59
|
modules: 'cjs'
|
59
60
|
}]]
|
60
61
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@modern-js/plugin-testing",
|
3
|
-
"version": "1.0.0-rc.
|
3
|
+
"version": "1.0.0-rc.16",
|
4
4
|
"jsnext:source": "./src/index.ts",
|
5
5
|
"types": "./dist/types/index.d.ts",
|
6
6
|
"main": "./dist/js/node/index.js",
|
@@ -12,28 +12,28 @@
|
|
12
12
|
"dependencies": {
|
13
13
|
"@babel/preset-env": "^7.15.6",
|
14
14
|
"@babel/runtime": "^7",
|
15
|
-
"@modern-js/babel-compiler": "^1.0.0-rc.
|
16
|
-
"@modern-js/testing": "^1.0.0-rc.
|
17
|
-
"@modern-js/utils": "^1.0.0-rc.
|
18
|
-
"@modern-js/webpack": "^1.0.0-rc.
|
15
|
+
"@modern-js/babel-compiler": "^1.0.0-rc.16",
|
16
|
+
"@modern-js/testing": "^1.0.0-rc.16",
|
17
|
+
"@modern-js/utils": "^1.0.0-rc.16",
|
18
|
+
"@modern-js/webpack": "^1.0.0-rc.16",
|
19
19
|
"@testing-library/jest-dom": "^5.14.1",
|
20
20
|
"@testing-library/react": "^12.0.0",
|
21
21
|
"enhanced-resolve": "^5.8.2"
|
22
22
|
},
|
23
23
|
"peerDependencies": {
|
24
|
-
"@modern-js/core": "^1.0.0-rc.
|
25
|
-
"@modern-js/runtime-core": "^1.0.0-rc.
|
24
|
+
"@modern-js/core": "^1.0.0-rc.16",
|
25
|
+
"@modern-js/runtime-core": "^1.0.0-rc.16"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
|
-
"@modern-js/core": "^1.0.0-rc.
|
29
|
-
"@modern-js/runtime-core": "^1.0.0-rc.
|
28
|
+
"@modern-js/core": "^1.0.0-rc.16",
|
29
|
+
"@modern-js/runtime-core": "^1.0.0-rc.16",
|
30
30
|
"@types/jest": "^26",
|
31
31
|
"@types/node": "^14",
|
32
32
|
"@types/react": "^17",
|
33
33
|
"@types/react-dom": "^17",
|
34
34
|
"typescript": "^4",
|
35
|
-
"@modern-js/plugin-testing": "^1.0.0-rc.
|
36
|
-
"@modern-js/module-tools": "^1.0.0-rc.
|
35
|
+
"@modern-js/plugin-testing": "^1.0.0-rc.16",
|
36
|
+
"@modern-js/module-tools": "^1.0.0-rc.16"
|
37
37
|
},
|
38
38
|
"sideEffects": false,
|
39
39
|
"modernConfig": {},
|
package/src/cli/index.ts
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
import
|
1
|
+
import {
|
2
|
+
path,
|
3
|
+
createRuntimeExportsUtils,
|
4
|
+
PLUGIN_SCHEMAS,
|
5
|
+
} from '@modern-js/utils';
|
2
6
|
import { createPlugin, useAppContext } from '@modern-js/core';
|
3
|
-
import { createRuntimeExportsUtils, PLUGIN_SCHEMAS } from '@modern-js/utils';
|
4
7
|
import test from './test';
|
5
8
|
|
6
9
|
export default createPlugin(
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import path from '
|
1
|
+
import { path } from '@modern-js/utils';
|
2
2
|
import { createPlugin } from '@modern-js/testing';
|
3
3
|
import { modernjs_config_key } from '@/constant';
|
4
|
+
import { upath } from '@modern-js/utils';
|
4
5
|
|
5
6
|
const getModuleNameMapper = (config: any) => {
|
6
7
|
const {
|
@@ -40,7 +41,7 @@ export default (webpackConfig: any, userConfig: any, pwd: string) =>
|
|
40
41
|
},
|
41
42
|
moduleNameMapper: getModuleNameMapper(webpackConfig),
|
42
43
|
testEnvironment: 'jsdom',
|
43
|
-
resolver: require.resolve('../resolver'),
|
44
|
+
resolver: upath.normalizeSafe(require.resolve('../resolver')),
|
44
45
|
});
|
45
46
|
|
46
47
|
utils.setJestConfig({
|
package/src/cli/test.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import path from '
|
1
|
+
import { path } from '@modern-js/utils';
|
2
2
|
import { compiler } from '@modern-js/babel-compiler';
|
3
|
+
import { upath } from '@modern-js/utils';
|
3
4
|
import { useAppContext, useResolvedConfigContext } from '@modern-js/core';
|
4
5
|
import { TestConfig, runTest } from '@modern-js/testing';
|
5
6
|
import { getWebpackConfig, WebpackConfigTarget } from '@modern-js/webpack';
|
@@ -51,7 +52,7 @@ const test = async () => {
|
|
51
52
|
{
|
52
53
|
presets: [
|
53
54
|
[
|
54
|
-
require.resolve('@babel/preset-env'),
|
55
|
+
upath.normalizeSafe(require.resolve('@babel/preset-env')),
|
55
56
|
{
|
56
57
|
modules: 'cjs',
|
57
58
|
},
|