@modern-js/plugin-testing 1.4.2 → 1.5.0
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 +23 -0
- package/dist/js/modern/cli/index.js +3 -3
- package/dist/js/node/cli/index.js +2 -2
- package/dist/js/treeshaking/cli/index.js +5 -5
- package/package.json +9 -9
- package/tests/.eslintrc.js +0 -6
- package/tests/index.test.ts +0 -7
- package/tests/merge-config.test.ts +0 -54
- package/tests/tsconfig.json +0 -13
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# @modern-js/plugin-testing
|
2
2
|
|
3
|
+
## 1.5.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 3bf4f8b0: feat: support start api server only
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- 04ae5262: chore: bump @modern-js/utils to v1.4.1 in dependencies
|
12
|
+
- 60f7d8bf: feat: add tests dir to npmignore
|
13
|
+
- Updated dependencies [b8599d09]
|
14
|
+
- Updated dependencies [6cffe99d]
|
15
|
+
- Updated dependencies [04ae5262]
|
16
|
+
- Updated dependencies [60f7d8bf]
|
17
|
+
- Updated dependencies [e4cec1ce]
|
18
|
+
- Updated dependencies [3bf4f8b0]
|
19
|
+
- @modern-js/utils@1.5.0
|
20
|
+
- @modern-js/webpack@1.5.5
|
21
|
+
- @modern-js/testing@1.4.3
|
22
|
+
- @modern-js/testing-plugin-bff@1.4.0
|
23
|
+
- @modern-js/runtime-core@1.4.2
|
24
|
+
- @modern-js/babel-compiler@1.2.3
|
25
|
+
|
3
26
|
## 1.4.2
|
4
27
|
|
5
28
|
### Patch Changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import path from 'path';
|
2
|
-
import {
|
2
|
+
import { PLUGIN_SCHEMAS, createRuntimeExportsUtils, isApiOnly } from '@modern-js/utils';
|
3
3
|
import { jestConfigHook, getModuleNameMapper, DEFAULT_RESOLVER_PATH } from '@modern-js/testing';
|
4
4
|
import { getWebpackConfig, WebpackConfigTarget } from '@modern-js/webpack';
|
5
5
|
import TestingBffPlugin from '@modern-js/testing-plugin-bff';
|
@@ -59,9 +59,9 @@ export default (() => {
|
|
59
59
|
},
|
60
60
|
|
61
61
|
jestConfig: async (utils, next) => {
|
62
|
-
const
|
62
|
+
const apiOnly = await isApiOnly(appContext.srcDirectory);
|
63
63
|
|
64
|
-
if (
|
64
|
+
if (apiOnly) {
|
65
65
|
return next(utils);
|
66
66
|
}
|
67
67
|
|
@@ -79,9 +79,9 @@ var _default = () => {
|
|
79
79
|
},
|
80
80
|
|
81
81
|
jestConfig: async (utils, next) => {
|
82
|
-
const
|
82
|
+
const apiOnly = await (0, _utils.isApiOnly)(appContext.srcDirectory);
|
83
83
|
|
84
|
-
if (
|
84
|
+
if (apiOnly) {
|
85
85
|
return next(utils);
|
86
86
|
}
|
87
87
|
|
@@ -7,7 +7,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
7
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
8
|
|
9
9
|
import path from 'path';
|
10
|
-
import {
|
10
|
+
import { PLUGIN_SCHEMAS, createRuntimeExportsUtils, isApiOnly } from '@modern-js/utils';
|
11
11
|
import { jestConfigHook, getModuleNameMapper, DEFAULT_RESOLVER_PATH } from '@modern-js/testing';
|
12
12
|
import { getWebpackConfig, WebpackConfigTarget } from '@modern-js/webpack';
|
13
13
|
import TestingBffPlugin from '@modern-js/testing-plugin-bff';
|
@@ -75,19 +75,19 @@ export default (function () {
|
|
75
75
|
},
|
76
76
|
jestConfig: function () {
|
77
77
|
var _jestConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(utils, next) {
|
78
|
-
var
|
78
|
+
var apiOnly, webpackConfig, _webpackConfig$resolv, alias;
|
79
79
|
|
80
80
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
81
81
|
while (1) {
|
82
82
|
switch (_context2.prev = _context2.next) {
|
83
83
|
case 0:
|
84
84
|
_context2.next = 2;
|
85
|
-
return
|
85
|
+
return isApiOnly(appContext.srcDirectory);
|
86
86
|
|
87
87
|
case 2:
|
88
|
-
|
88
|
+
apiOnly = _context2.sent;
|
89
89
|
|
90
|
-
if (
|
90
|
+
if (!apiOnly) {
|
91
91
|
_context2.next = 5;
|
92
92
|
break;
|
93
93
|
}
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "1.
|
14
|
+
"version": "1.5.0",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/types/index.d.ts",
|
17
17
|
"main": "./dist/js/node/index.js",
|
@@ -83,20 +83,20 @@
|
|
83
83
|
"dependencies": {
|
84
84
|
"@babel/preset-env": "^7.15.6",
|
85
85
|
"@babel/runtime": "^7",
|
86
|
-
"@modern-js/babel-compiler": "^1.2.
|
87
|
-
"@modern-js/testing": "^1.4.
|
88
|
-
"@modern-js/utils": "^1.
|
89
|
-
"@modern-js/webpack": "^1.5.
|
86
|
+
"@modern-js/babel-compiler": "^1.2.3",
|
87
|
+
"@modern-js/testing": "^1.4.3",
|
88
|
+
"@modern-js/utils": "^1.5.0",
|
89
|
+
"@modern-js/webpack": "^1.5.6",
|
90
90
|
"@testing-library/jest-dom": "^5.14.1",
|
91
91
|
"@testing-library/react": "^12.0.0",
|
92
|
-
"@modern-js/testing-plugin-bff": "^1.
|
92
|
+
"@modern-js/testing-plugin-bff": "^1.4.0"
|
93
93
|
},
|
94
94
|
"peerDependencies": {
|
95
95
|
"@modern-js-reduck/plugin-auto-actions": "^1.0.0",
|
96
96
|
"@modern-js-reduck/plugin-effects": "^1.0.0",
|
97
97
|
"@modern-js-reduck/plugin-immutable": "^1.0.0",
|
98
98
|
"@modern-js-reduck/store": "^1.0.0",
|
99
|
-
"@modern-js/runtime-core": "^1.4.
|
99
|
+
"@modern-js/runtime-core": "^1.4.2"
|
100
100
|
},
|
101
101
|
"devDependencies": {
|
102
102
|
"@modern-js-reduck/plugin-auto-actions": "^1.0.0",
|
@@ -104,8 +104,8 @@
|
|
104
104
|
"@modern-js-reduck/plugin-immutable": "^1.0.0",
|
105
105
|
"@modern-js-reduck/store": "^1.0.0",
|
106
106
|
"@scripts/build": "0.0.0",
|
107
|
-
"@modern-js/core": "1.
|
108
|
-
"@modern-js/runtime-core": "1.4.
|
107
|
+
"@modern-js/core": "1.8.0",
|
108
|
+
"@modern-js/runtime-core": "1.4.2",
|
109
109
|
"@types/jest": "^26",
|
110
110
|
"@types/node": "^14",
|
111
111
|
"@types/react": "^17",
|
package/tests/.eslintrc.js
DELETED
package/tests/index.test.ts
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
import { mergeUserJestConfig } from '../src/cli';
|
2
|
-
|
3
|
-
describe('mergeUserJestConfig', () => {
|
4
|
-
test('mergeUserJestConfig support object', () => {
|
5
|
-
const testUtils: any = {
|
6
|
-
_jestConfig: {
|
7
|
-
a: 1,
|
8
|
-
},
|
9
|
-
get jestConfig() {
|
10
|
-
return this._jestConfig;
|
11
|
-
},
|
12
|
-
testConfig: {
|
13
|
-
jest: {
|
14
|
-
b: 1,
|
15
|
-
},
|
16
|
-
},
|
17
|
-
mergeJestConfig(config: Record<string, string>) {
|
18
|
-
Object.assign(this._jestConfig, config);
|
19
|
-
},
|
20
|
-
};
|
21
|
-
|
22
|
-
mergeUserJestConfig(testUtils);
|
23
|
-
|
24
|
-
expect(testUtils.jestConfig).toEqual({
|
25
|
-
a: 1,
|
26
|
-
b: 1,
|
27
|
-
});
|
28
|
-
});
|
29
|
-
|
30
|
-
test('mergeUserJestConfig support function', () => {
|
31
|
-
const testUtils: any = {
|
32
|
-
_jestConfig: {
|
33
|
-
a: 1,
|
34
|
-
},
|
35
|
-
get jestConfig() {
|
36
|
-
return this._jestConfig;
|
37
|
-
},
|
38
|
-
testConfig: {
|
39
|
-
jest: (jestConfig: Record<string, number>) => {
|
40
|
-
jestConfig.b = 1;
|
41
|
-
},
|
42
|
-
},
|
43
|
-
mergeJestConfig(config: Record<string, string>) {
|
44
|
-
Object.assign(this._jestConfig, config);
|
45
|
-
},
|
46
|
-
};
|
47
|
-
|
48
|
-
mergeUserJestConfig(testUtils);
|
49
|
-
expect(testUtils.jestConfig).toEqual({
|
50
|
-
a: 1,
|
51
|
-
b: 1,
|
52
|
-
});
|
53
|
-
});
|
54
|
-
});
|
package/tests/tsconfig.json
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": "@modern-js/tsconfig/base",
|
3
|
-
"compilerOptions": {
|
4
|
-
"declaration": true,
|
5
|
-
"jsx": "preserve",
|
6
|
-
"baseUrl": "./",
|
7
|
-
"outDir": "./out",
|
8
|
-
"emitDeclarationOnly": true,
|
9
|
-
"isolatedModules": true,
|
10
|
-
"paths": {},
|
11
|
-
"types": ["node", "jest"]
|
12
|
-
}
|
13
|
-
}
|