@eggjs/mock 7.0.2-beta.4 → 7.0.2-beta.6
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.
|
@@ -51,6 +51,7 @@ function formatOptions(initOptions) {
|
|
|
51
51
|
const env = process.env.EGG_SERVER_ENV;
|
|
52
52
|
if (!isMocked(process.env, "HOME") && (env === "default" || env === "test" || env === "prod")) mm(process.env, "HOME", options.baseDir);
|
|
53
53
|
if (process.env.EGG_MOCK_SERVER_ENV) options.cache = false;
|
|
54
|
+
if (!options.startMode && process.env.EGG_VITEST_POOL === "threads") options.startMode = "worker_threads";
|
|
54
55
|
debug("[formatOptions] options: %j", options);
|
|
55
56
|
return options;
|
|
56
57
|
}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ interface MockOptions {
|
|
|
46
46
|
*/
|
|
47
47
|
mockCtxStorage?: boolean;
|
|
48
48
|
beforeInit?: (app: any) => Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Start mode for egg cluster-client
|
|
51
|
+
*/
|
|
52
|
+
startMode?: "process" | "worker_threads";
|
|
49
53
|
}
|
|
50
54
|
interface MockClusterOptions extends MockOptions {
|
|
51
55
|
workers?: number | string;
|
package/dist/setup_vitest.js
CHANGED
|
@@ -32,6 +32,7 @@ afterEach(async () => {
|
|
|
32
32
|
await proxyMock.restore();
|
|
33
33
|
});
|
|
34
34
|
afterAll(async () => {
|
|
35
|
+
if (globalThis.__eggVitestSharedMode || process.env.EGG_VITEST_ISOLATE === "false" || process.env.EGG_VITEST_POOL === "threads") return;
|
|
35
36
|
if (app) await app.close();
|
|
36
37
|
});
|
|
37
38
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/mock",
|
|
3
|
-
"version": "7.0.2-beta.
|
|
3
|
+
"version": "7.0.2-beta.6",
|
|
4
4
|
"description": "mock server plugin for egg",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"egg",
|
|
@@ -72,20 +72,20 @@
|
|
|
72
72
|
"sdk-base": "^5.0.1",
|
|
73
73
|
"urllib": "^4.8.2",
|
|
74
74
|
"utility": "^2.5.0",
|
|
75
|
-
"@eggjs/
|
|
76
|
-
"@eggjs/
|
|
77
|
-
"@eggjs/supertest": "9.0.2-beta.
|
|
75
|
+
"@eggjs/extend2": "5.0.2-beta.6",
|
|
76
|
+
"@eggjs/utils": "5.0.2-beta.6",
|
|
77
|
+
"@eggjs/supertest": "9.0.2-beta.6"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@types/methods": "^1.1.4",
|
|
81
81
|
"typescript": "^5.9.3",
|
|
82
|
-
"@eggjs/errors": "3.0.2-beta.
|
|
83
|
-
"egg": "4.1.2-beta.
|
|
84
|
-
"@eggjs/tracer": "4.0.2-beta.
|
|
82
|
+
"@eggjs/errors": "3.0.2-beta.6",
|
|
83
|
+
"egg": "4.1.2-beta.6",
|
|
84
|
+
"@eggjs/tracer": "4.0.2-beta.6"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"vitest": "^4.0.15",
|
|
88
|
-
"egg": "4.1.2-beta.
|
|
88
|
+
"egg": "4.1.2-beta.6"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|
|
91
91
|
"vitest": {
|