@modern-js/plugin-testing 1.21.5 → 2.0.0-beta.1
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 +88 -29
- package/dist/js/modern/base/config/index.js +1 -3
- package/dist/js/modern/base/config/patches/index.js +0 -2
- package/dist/js/modern/base/config/patches/transformer.js +1 -7
- package/dist/js/modern/base/config/resolver.js +0 -3
- package/dist/js/modern/base/config/testConfigOperator.js +0 -23
- package/dist/js/modern/base/config/transformer/babelTransformer.js +0 -1
- package/dist/js/modern/base/runJest.js +11 -14
- package/dist/js/modern/base/utils.js +2 -12
- package/dist/js/modern/cli/bff/app.js +1 -8
- package/dist/js/modern/cli/bff/index.js +5 -17
- package/dist/js/modern/cli/bff/mockAPI.js +4 -20
- package/dist/js/modern/cli/bff/setup.js +0 -5
- package/dist/js/modern/cli/bff/utils/index.js +0 -4
- package/dist/js/modern/cli/index.js +7 -15
- package/dist/js/modern/cli/test.js +0 -4
- package/dist/js/modern/runtime-testing/app.js +0 -15
- package/dist/js/modern/runtime-testing/customRender.js +0 -6
- package/dist/js/modern/runtime-testing/reduck.js +0 -10
- package/dist/js/modern/runtime-testing/request.js +1 -4
- package/dist/js/modern/runtime-testing/resolvePlugins.js +0 -6
- package/dist/js/node/base/config/index.js +0 -8
- package/dist/js/node/base/config/patches/assetsModule.js +0 -2
- package/dist/js/node/base/config/patches/index.js +0 -6
- package/dist/js/node/base/config/patches/transformer.js +1 -9
- package/dist/js/node/base/config/resolver.js +0 -5
- package/dist/js/node/base/config/testConfigOperator.js +0 -24
- package/dist/js/node/base/config/transformer/babelTransformer.js +0 -4
- package/dist/js/node/base/hook.js +0 -2
- package/dist/js/node/base/index.js +0 -7
- package/dist/js/node/base/runJest.js +11 -21
- package/dist/js/node/base/utils.js +2 -22
- package/dist/js/node/cli/bff/app.js +1 -15
- package/dist/js/node/cli/bff/index.js +5 -27
- package/dist/js/node/cli/bff/mockAPI.js +2 -25
- package/dist/js/node/cli/bff/setup.js +0 -11
- package/dist/js/node/cli/bff/utils/index.js +0 -9
- package/dist/js/node/cli/index.js +6 -27
- package/dist/js/node/cli/test.js +0 -10
- package/dist/js/node/index.js +0 -4
- package/dist/js/node/runtime-testing/app.js +0 -20
- package/dist/js/node/runtime-testing/base.js +0 -5
- package/dist/js/node/runtime-testing/customRender.js +0 -10
- package/dist/js/node/runtime-testing/index.js +0 -4
- package/dist/js/node/runtime-testing/reduck.js +0 -24
- package/dist/js/node/runtime-testing/request.js +1 -6
- package/dist/js/node/runtime-testing/resolvePlugins.js +0 -8
- package/dist/js/treeshaking/base/config/index.js +1 -6
- package/dist/js/treeshaking/base/config/patches/index.js +0 -17
- package/dist/js/treeshaking/base/config/patches/transformer.js +1 -7
- package/dist/js/treeshaking/base/config/resolver.js +0 -3
- package/dist/js/treeshaking/base/config/testConfigOperator.js +0 -15
- package/dist/js/treeshaking/base/config/transformer/babelTransformer.js +0 -1
- package/dist/js/treeshaking/base/runJest.js +19 -38
- package/dist/js/treeshaking/base/utils.js +2 -10
- package/dist/js/treeshaking/cli/bff/app.js +1 -14
- package/dist/js/treeshaking/cli/bff/index.js +5 -24
- package/dist/js/treeshaking/cli/bff/mockAPI.js +8 -24
- package/dist/js/treeshaking/cli/bff/setup.js +0 -9
- package/dist/js/treeshaking/cli/bff/utils/index.js +1 -2
- package/dist/js/treeshaking/cli/index.js +8 -15
- package/dist/js/treeshaking/cli/test.js +0 -7
- package/dist/js/treeshaking/runtime-testing/app.js +2 -15
- package/dist/js/treeshaking/runtime-testing/customRender.js +0 -3
- package/dist/js/treeshaking/runtime-testing/reduck.js +0 -7
- package/dist/js/treeshaking/runtime-testing/request.js +2 -7
- package/dist/js/treeshaking/runtime-testing/resolvePlugins.js +0 -3
- package/dist/types/base/config/index.d.ts +0 -1
- package/dist/types/base/config/patches/assetsModule.d.ts +0 -1
- package/dist/types/base/config/patches/filemock.d.ts +0 -1
- package/dist/types/base/config/patches/transformer.d.ts +0 -1
- package/dist/types/base/config/testConfigOperator.d.ts +0 -2
- package/dist/types/base/runJest.d.ts +0 -2
- package/dist/types/base/utils.d.ts +0 -1
- package/dist/types/cli/bff/app.d.ts +2 -1
- package/dist/types/cli/bff/index.d.ts +2 -3
- package/dist/types/cli/bff/mockAPI.d.ts +0 -1
- package/dist/types/cli/index.d.ts +0 -2
- package/dist/types/runtime-testing/app.d.ts +0 -3
- package/dist/types/runtime-testing/customRender.d.ts +0 -2
- package/package.json +18 -41
|
@@ -12,11 +12,9 @@ declare type Argv = Omit<Config.Argv, '_' | '$0'>;
|
|
|
12
12
|
/**
|
|
13
13
|
* Node API: execute jest
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
export declare function runJest(config: Argv, pwd?: string): Promise<void>;
|
|
17
16
|
/**
|
|
18
17
|
* Node API: run test
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
19
|
export declare function runTest(api: PluginAPI, config: TestConfig, pwd?: string): Promise<void>;
|
|
22
20
|
export {};
|
|
@@ -6,7 +6,6 @@ interface TSConfig {
|
|
|
6
6
|
/**
|
|
7
7
|
* Read `compilerOptions` in the current pwd's tsconfig.json file
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
9
|
export declare const readCompilerOptions: (pwd?: string, filename?: string) => TSConfig['compilerOptions'];
|
|
11
10
|
export declare const getModuleNameMapper: (alias: any) => any;
|
|
12
11
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node/http" />
|
|
3
3
|
/// <reference types="@modern-js/prod-server/src/type" />
|
|
4
|
+
import { InternalPlugins } from '@modern-js/types';
|
|
4
5
|
export declare const isInHandler: () => boolean;
|
|
5
|
-
declare const createApp: (pwd: string, config: any, plugins:
|
|
6
|
+
declare const createApp: (pwd: string, config: any, plugins: InternalPlugins, routes: any[]) => Promise<(req: import("http").IncomingMessage, res: import("http").ServerResponse, next?: (() => void) | undefined) => void>;
|
|
6
7
|
declare const getApp: () => (req: import("http").IncomingMessage, res: import("http").ServerResponse, next?: (() => void) | undefined) => void;
|
|
7
8
|
declare const closeServer: () => Promise<void>;
|
|
8
9
|
export { createApp, getApp, closeServer };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CliPlugin } from '@modern-js/core';
|
|
2
|
+
import { InternalPlugins } from '@modern-js/types';
|
|
2
3
|
import { TestConfigOperator } from '../../base';
|
|
3
4
|
export declare const setJestConfigForBFF: ({
|
|
4
5
|
pwd,
|
|
@@ -9,11 +10,9 @@ export declare const setJestConfigForBFF: ({
|
|
|
9
10
|
}: {
|
|
10
11
|
pwd: string;
|
|
11
12
|
userConfig: any;
|
|
12
|
-
plugins:
|
|
13
|
+
plugins: InternalPlugins;
|
|
13
14
|
routes: any[];
|
|
14
15
|
utils: TestConfigOperator;
|
|
15
16
|
}) => Promise<void>;
|
|
16
|
-
|
|
17
17
|
declare const _default: () => CliPlugin;
|
|
18
|
-
|
|
19
18
|
export default _default;
|
|
@@ -4,14 +4,11 @@ interface CreateAppProps {
|
|
|
4
4
|
entry?: string;
|
|
5
5
|
children?: React.ReactElement;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
declare class ModernRuntime {
|
|
9
8
|
private options;
|
|
10
9
|
constructor(options: UserConfig);
|
|
11
10
|
init(options: UserConfig): void;
|
|
12
11
|
createApp(props?: CreateAppProps): React.ComponentType<any>;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
declare const _default: ModernRuntime;
|
|
16
|
-
|
|
17
14
|
export default _default;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "
|
|
14
|
+
"version": "2.0.0-beta.1",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"@modern-js-reduck/plugin-immutable": "^1.0.1",
|
|
101
101
|
"@modern-js-reduck/store": "^1.0.3",
|
|
102
102
|
"@testing-library/jest-dom": "^5.14.1",
|
|
103
|
-
"@testing-library/react": "^
|
|
103
|
+
"@testing-library/react": "^13.4.0",
|
|
104
104
|
"@types/testing-library__jest-dom": "^5.14.3",
|
|
105
105
|
"jest-environment-node": "^27.2.2",
|
|
106
106
|
"path-to-regexp": "^6.2.0",
|
|
@@ -111,17 +111,16 @@
|
|
|
111
111
|
"jest": "^27.0.6",
|
|
112
112
|
"ts-jest": "^27.0.4",
|
|
113
113
|
"yargs": "^17.0.1",
|
|
114
|
-
"@modern-js/babel-compiler": "
|
|
115
|
-
"@modern-js/utils": "
|
|
116
|
-
"@modern-js/
|
|
117
|
-
"@modern-js/
|
|
118
|
-
"@modern-js/
|
|
119
|
-
"@modern-js/prod-server": "1.21.5"
|
|
114
|
+
"@modern-js/babel-compiler": "2.0.0-beta.1",
|
|
115
|
+
"@modern-js/utils": "2.0.0-beta.1",
|
|
116
|
+
"@modern-js/babel-preset-app": "2.0.0-beta.1",
|
|
117
|
+
"@modern-js/plugin": "2.0.0-beta.1",
|
|
118
|
+
"@modern-js/prod-server": "2.0.0-beta.1"
|
|
120
119
|
},
|
|
121
120
|
"peerDependencies": {
|
|
122
121
|
"react": ">=17",
|
|
123
122
|
"react-dom": ">=17",
|
|
124
|
-
"@modern-js/runtime": "^
|
|
123
|
+
"@modern-js/runtime": "^2.0.0-beta.1"
|
|
125
124
|
},
|
|
126
125
|
"peerDependenciesMeta": {
|
|
127
126
|
"@modern-js/runtime": {
|
|
@@ -129,8 +128,8 @@
|
|
|
129
128
|
}
|
|
130
129
|
},
|
|
131
130
|
"devDependencies": {
|
|
132
|
-
"react": "^
|
|
133
|
-
"react-dom": "^
|
|
131
|
+
"react": "^18",
|
|
132
|
+
"react-dom": "^18",
|
|
134
133
|
"@types/jest": "^27",
|
|
135
134
|
"@types/supertest": "^2.0.11",
|
|
136
135
|
"@types/node": "^14",
|
|
@@ -138,11 +137,12 @@
|
|
|
138
137
|
"@jest/types": "^27.0.6",
|
|
139
138
|
"jest": "^27",
|
|
140
139
|
"typescript": "^4",
|
|
141
|
-
"@modern-js/core": "
|
|
142
|
-
"@modern-js/
|
|
143
|
-
"@modern-js/
|
|
144
|
-
"@
|
|
145
|
-
"@scripts/
|
|
140
|
+
"@modern-js/core": "2.0.0-beta.1",
|
|
141
|
+
"@modern-js/types": "2.0.0-beta.1",
|
|
142
|
+
"@modern-js/runtime": "2.0.0-beta.1",
|
|
143
|
+
"@modern-js/bff-core": "2.0.0-beta.1",
|
|
144
|
+
"@scripts/build": "2.0.0-beta.1",
|
|
145
|
+
"@scripts/jest-config": "2.0.0-beta.1"
|
|
146
146
|
},
|
|
147
147
|
"sideEffects": false,
|
|
148
148
|
"modernConfig": {},
|
|
@@ -150,33 +150,10 @@
|
|
|
150
150
|
"registry": "https://registry.npmjs.org/",
|
|
151
151
|
"access": "public"
|
|
152
152
|
},
|
|
153
|
-
"wireit": {
|
|
154
|
-
"build": {
|
|
155
|
-
"command": "modern build",
|
|
156
|
-
"files": [
|
|
157
|
-
"src/**/*",
|
|
158
|
-
"tsconfig.json",
|
|
159
|
-
"package.json"
|
|
160
|
-
],
|
|
161
|
-
"output": [
|
|
162
|
-
"dist/**/*"
|
|
163
|
-
]
|
|
164
|
-
},
|
|
165
|
-
"test": {
|
|
166
|
-
"command": "jest",
|
|
167
|
-
"files": [
|
|
168
|
-
"src/**/*",
|
|
169
|
-
"tsconfig.json",
|
|
170
|
-
"package.json",
|
|
171
|
-
"tests/**/*"
|
|
172
|
-
],
|
|
173
|
-
"output": []
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
153
|
"scripts": {
|
|
177
154
|
"new": "modern new",
|
|
178
155
|
"dev": "modern build --watch",
|
|
179
|
-
"build": "
|
|
180
|
-
"test": "
|
|
156
|
+
"build": "modern build",
|
|
157
|
+
"test": "jest"
|
|
181
158
|
}
|
|
182
159
|
}
|