@midwayjs/mock 4.0.0-beta.1 → 4.0.0-beta.11

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/README.md CHANGED
@@ -9,4 +9,4 @@ Document: [https://midwayjs.org](https://midwayjs.org)
9
9
 
10
10
  ## License
11
11
 
12
- [MIT]((https://github.com/midwayjs/midway/blob/master/LICENSE))
12
+ [MIT](https://github.com/midwayjs/midway/blob/master/LICENSE)
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createHttpRequest = void 0;
3
+ exports.createHttpRequest = createHttpRequest;
4
4
  const request = require("supertest");
5
5
  function createHttpRequest(app) {
6
6
  if (app.callback2) {
@@ -13,5 +13,4 @@ function createHttpRequest(app) {
13
13
  return request(app);
14
14
  }
15
15
  }
16
- exports.createHttpRequest = createHttpRequest;
17
16
  //# sourceMappingURL=http.js.map
@@ -3,4 +3,5 @@ export * from './rabbitMQ';
3
3
  export * from './socketio';
4
4
  export * from './ws.client';
5
5
  export * from './kafka';
6
+ export * from './sse';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -19,4 +19,5 @@ __exportStar(require("./rabbitMQ"), exports);
19
19
  __exportStar(require("./socketio"), exports);
20
20
  __exportStar(require("./ws.client"), exports);
21
21
  __exportStar(require("./kafka"), exports);
22
+ __exportStar(require("./sse"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createKafkaProducer = void 0;
3
+ exports.createKafkaProducer = createKafkaProducer;
4
4
  const connect = async () => ({
5
5
  producer: () => { },
6
6
  cousumer: () => { },
@@ -15,5 +15,4 @@ async function createKafkaProducer(options = {
15
15
  const kafka = new Kafka(options.kafkaConfig);
16
16
  return kafka.producer(options.producerConfig);
17
17
  }
18
- exports.createKafkaProducer = createKafkaProducer;
19
18
  //# sourceMappingURL=kafka.js.map
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import type { Channel, Options } from 'amqplib';
4
2
  declare class ChannelManager {
5
3
  private connection;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createRabbitMQProducer = void 0;
3
+ exports.createRabbitMQProducer = createRabbitMQProducer;
4
4
  const queues = {};
5
5
  const exchanges = {};
6
6
  const eventListeners = [];
@@ -282,8 +282,10 @@ const connect = async () => ({
282
282
  close: () => { },
283
283
  });
284
284
  class ChannelManager {
285
+ connection;
286
+ channel;
287
+ channelList = [];
285
288
  constructor(connection) {
286
- this.channelList = [];
287
289
  this.connection = connection;
288
290
  }
289
291
  async assertQueue(queue, options) {
@@ -344,5 +346,4 @@ async function createRabbitMQProducer(queueName, options = {
344
346
  return channelManager;
345
347
  }
346
348
  }
347
- exports.createRabbitMQProducer = createRabbitMQProducer;
348
349
  //# sourceMappingURL=rabbitMQ.js.map
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ManagerOptions, SocketOptions } from 'socket.io-client';
3
2
  export interface MidwaySocketIOClientOptions extends Partial<ManagerOptions & SocketOptions> {
4
3
  url?: string;
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSocketIOClient = exports.SocketIOWrapperClient = void 0;
3
+ exports.SocketIOWrapperClient = void 0;
4
+ exports.createSocketIOClient = createSocketIOClient;
4
5
  class SocketIOWrapperClient {
6
+ socket;
5
7
  constructor(socket) {
6
8
  this.socket = socket;
7
9
  }
@@ -57,5 +59,4 @@ async function createSocketIOClient(opts) {
57
59
  await client.connect();
58
60
  return client;
59
61
  }
60
- exports.createSocketIOClient = createSocketIOClient;
61
62
  //# sourceMappingURL=socketio.js.map
@@ -0,0 +1,22 @@
1
+ import { EventEmitter } from 'events';
2
+ export interface SSEClientOptions {
3
+ headers?: Record<string, string>;
4
+ timeout?: number;
5
+ reconnectInterval?: number;
6
+ maxReconnectAttempts?: number;
7
+ }
8
+ export declare class SSEClient extends EventEmitter {
9
+ private url;
10
+ private options;
11
+ private request?;
12
+ private reconnectAttempts;
13
+ private shouldReconnect;
14
+ private reconnectTimer?;
15
+ constructor(url: string, options?: SSEClientOptions);
16
+ connect(): Promise<void>;
17
+ private processLine;
18
+ private scheduleReconnect;
19
+ close(): void;
20
+ }
21
+ export declare function createSSEClient(url: string, options?: SSEClientOptions): SSEClient;
22
+ //# sourceMappingURL=sse.d.ts.map
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SSEClient = void 0;
4
+ exports.createSSEClient = createSSEClient;
5
+ const http = require("http");
6
+ const https = require("https");
7
+ const events_1 = require("events");
8
+ class SSEClient extends events_1.EventEmitter {
9
+ url;
10
+ options;
11
+ request;
12
+ reconnectAttempts = 0;
13
+ shouldReconnect = true;
14
+ reconnectTimer;
15
+ constructor(url, options = {}) {
16
+ super();
17
+ this.url = url;
18
+ this.options = options;
19
+ this.options = {
20
+ timeout: 30000,
21
+ reconnectInterval: 3000,
22
+ maxReconnectAttempts: 5,
23
+ ...options,
24
+ };
25
+ }
26
+ connect() {
27
+ return new Promise((resolve, reject) => {
28
+ const parsedUrl = new URL(this.url);
29
+ const isSecure = parsedUrl.protocol === 'https:';
30
+ const httpModule = isSecure ? https : http;
31
+ const requestOptions = {
32
+ hostname: parsedUrl.hostname,
33
+ port: parsedUrl.port,
34
+ path: parsedUrl.pathname + parsedUrl.search,
35
+ method: 'GET',
36
+ headers: {
37
+ Accept: 'text/event-stream',
38
+ 'Cache-Control': 'no-cache',
39
+ Connection: 'keep-alive',
40
+ ...this.options.headers,
41
+ },
42
+ };
43
+ this.request = httpModule.request(requestOptions, response => {
44
+ if (response.statusCode !== 200) {
45
+ reject(new Error(`SSE connection failed with status: ${response.statusCode}`));
46
+ return;
47
+ }
48
+ this.reconnectAttempts = 0;
49
+ this.emit('connected');
50
+ resolve();
51
+ response.setEncoding('utf8');
52
+ let buffer = '';
53
+ response.on('data', (chunk) => {
54
+ buffer += chunk;
55
+ const lines = buffer.split('\n');
56
+ buffer = lines.pop() || '';
57
+ for (const line of lines) {
58
+ this.processLine(line);
59
+ }
60
+ });
61
+ response.on('end', () => {
62
+ this.emit('disconnected');
63
+ if (this.shouldReconnect &&
64
+ this.reconnectAttempts < (this.options.maxReconnectAttempts || 5)) {
65
+ this.scheduleReconnect();
66
+ }
67
+ });
68
+ response.on('error', error => {
69
+ this.emit('error', error);
70
+ });
71
+ });
72
+ this.request.on('error', error => {
73
+ reject(error);
74
+ if (this.shouldReconnect &&
75
+ this.reconnectAttempts < (this.options.maxReconnectAttempts || 5)) {
76
+ this.scheduleReconnect();
77
+ }
78
+ });
79
+ this.request.on('timeout', () => {
80
+ this.request?.destroy();
81
+ reject(new Error('SSE connection timeout'));
82
+ });
83
+ if (this.options.timeout) {
84
+ this.request.setTimeout(this.options.timeout);
85
+ }
86
+ this.request.end();
87
+ });
88
+ }
89
+ processLine(line) {
90
+ if (line.trim() === '') {
91
+ return;
92
+ }
93
+ if (line.startsWith('data: ')) {
94
+ const data = line.substring(6);
95
+ try {
96
+ const parsed = JSON.parse(data);
97
+ this.emit('message', parsed);
98
+ }
99
+ catch {
100
+ this.emit('message', data);
101
+ }
102
+ }
103
+ else if (line.startsWith('event: ')) {
104
+ const eventType = line.substring(7);
105
+ this.emit('event', eventType);
106
+ }
107
+ else if (line.startsWith('id: ')) {
108
+ const id = line.substring(4);
109
+ this.emit('id', id);
110
+ }
111
+ else if (line.startsWith('retry: ')) {
112
+ const retry = parseInt(line.substring(7), 10);
113
+ if (!isNaN(retry)) {
114
+ this.options.reconnectInterval = retry;
115
+ }
116
+ }
117
+ }
118
+ scheduleReconnect() {
119
+ if (this.reconnectTimer) {
120
+ clearTimeout(this.reconnectTimer);
121
+ }
122
+ this.reconnectAttempts++;
123
+ this.reconnectTimer = setTimeout(() => {
124
+ this.connect().catch(error => {
125
+ this.emit('error', error);
126
+ });
127
+ }, this.options.reconnectInterval);
128
+ }
129
+ close() {
130
+ this.shouldReconnect = false;
131
+ if (this.reconnectTimer) {
132
+ clearTimeout(this.reconnectTimer);
133
+ }
134
+ if (this.request) {
135
+ this.request.destroy();
136
+ }
137
+ this.emit('closed');
138
+ }
139
+ }
140
+ exports.SSEClient = SSEClient;
141
+ function createSSEClient(url, options) {
142
+ return new SSEClient(url, options);
143
+ }
144
+ //# sourceMappingURL=sse.js.map
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import * as WebSocket from 'ws';
4
2
  import * as http from 'http';
5
3
  import * as url from 'url';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createWebSocketClient = void 0;
3
+ exports.createWebSocketClient = createWebSocketClient;
4
4
  async function createWebSocketClient(address, options) {
5
5
  const WebSocket = require('ws');
6
6
  const client = new WebSocket(address, options);
@@ -10,5 +10,4 @@ async function createWebSocketClient(address, options) {
10
10
  });
11
11
  });
12
12
  }
13
- exports.createWebSocketClient = createWebSocketClient;
14
13
  //# sourceMappingURL=ws.client.js.map
package/dist/creator.js CHANGED
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createBootstrap = exports.createLightApp = exports.createFunctionApp = exports.close = exports.createApp = exports.create = void 0;
3
+ exports.create = create;
4
+ exports.createApp = createApp;
5
+ exports.close = close;
6
+ exports.createFunctionApp = createFunctionApp;
7
+ exports.createLightApp = createLightApp;
8
+ exports.createBootstrap = createBootstrap;
4
9
  const core_1 = require("@midwayjs/core");
5
10
  const path_1 = require("path");
6
11
  const logger_1 = require("@midwayjs/logger");
@@ -9,6 +14,7 @@ const util_1 = require("util");
9
14
  const fs_1 = require("fs");
10
15
  const yaml = require("js-yaml");
11
16
  const getRawBody = require("raw-body");
17
+ const functional_1 = require("@midwayjs/core/functional");
12
18
  const debug = (0, util_1.debuglog)('midway:debug');
13
19
  process.setMaxListeners(0);
14
20
  function formatPath(baseDir, p) {
@@ -75,7 +81,7 @@ async function create(appDir, options = {}) {
75
81
  options = appDir;
76
82
  appDir = options.appDir || '';
77
83
  }
78
- debug(`[mock]: Create app, appDir="${appDir}"`);
84
+ debug(`[mock]: Create app, appDir="${appDir}", will be initialized.`);
79
85
  try {
80
86
  if (appDir) {
81
87
  // 处理测试的 fixtures
@@ -155,12 +161,32 @@ async function create(appDir, options = {}) {
155
161
  };
156
162
  options.globalConfig = (0, utils_1.mergeGlobalConfig)(options.globalConfig, sslConfig);
157
163
  }
164
+ const anonymousConfiguration = (0, functional_1.defineConfiguration)({
165
+ namespace: 'mock-anonymous',
166
+ async onReady(...args) {
167
+ return options.onReady?.(...args);
168
+ },
169
+ async onStop(...args) {
170
+ return options.onStop?.(...args);
171
+ },
172
+ async onConfigLoad(...args) {
173
+ return options.onConfigLoad?.(...args);
174
+ },
175
+ async onServerReady(...args) {
176
+ return options.onServerReady?.(...args);
177
+ },
178
+ async onHealthCheck(...args) {
179
+ return options.onHealthCheck?.(...args);
180
+ },
181
+ });
158
182
  const container = createMockWrapApplicationContext();
159
183
  options.applicationContext = container;
184
+ options.imports = options.imports || [];
185
+ options.imports.push(anonymousConfiguration);
160
186
  await (0, core_1.initializeGlobalApplicationContext)({
187
+ loggerFactory: logger_1.loggers,
161
188
  ...options,
162
189
  appDir,
163
- loggerFactory: logger_1.loggers,
164
190
  });
165
191
  const frameworkService = await container.getAsync(core_1.MidwayFrameworkService);
166
192
  const mainFramework = frameworkService.getMainFramework();
@@ -179,12 +205,10 @@ async function create(appDir, options = {}) {
179
205
  throw err;
180
206
  }
181
207
  }
182
- exports.create = create;
183
208
  async function createApp(baseDir, options) {
184
209
  const framework = await create(baseDir, options);
185
210
  return framework.getApplication();
186
211
  }
187
- exports.createApp = createApp;
188
212
  async function close(app, options) {
189
213
  if (!app)
190
214
  return;
@@ -216,7 +240,6 @@ async function close(app, options) {
216
240
  }
217
241
  }
218
242
  }
219
- exports.close = close;
220
243
  async function createFunctionApp(baseDir, options = {}, customFrameworkModule) {
221
244
  process.env.MIDWAY_TS_MODE = process.env.MIDWAY_TS_MODE ?? 'true';
222
245
  if (typeof baseDir === 'object') {
@@ -429,7 +452,6 @@ async function createFunctionApp(baseDir, options = {}, customFrameworkModule) {
429
452
  return appManager.getApplication('serverless-app');
430
453
  }
431
454
  }
432
- exports.createFunctionApp = createFunctionApp;
433
455
  /**
434
456
  * 一个全量的空框架
435
457
  */
@@ -447,6 +469,7 @@ class LightFramework extends core_1.BaseFramework {
447
469
  }
448
470
  }
449
471
  class BootstrapAppStarter {
472
+ options;
450
473
  constructor(options) {
451
474
  this.options = options;
452
475
  }
@@ -522,7 +545,6 @@ async function createLightApp(baseDirOrOptions, options = {}) {
522
545
  return frameworkService.getMainApp();
523
546
  }
524
547
  }
525
- exports.createLightApp = createLightApp;
526
548
  async function createBootstrap(entryFile, options = {}) {
527
549
  const cwd = process.cwd();
528
550
  if (!options.bootstrapMode) {
@@ -546,5 +568,4 @@ async function createBootstrap(entryFile, options = {}) {
546
568
  return new BootstrapAppStarter(options);
547
569
  }
548
570
  }
549
- exports.createBootstrap = createBootstrap;
550
571
  //# sourceMappingURL=creator.js.map
@@ -1,5 +1,5 @@
1
- import { IMidwayApplication, IMidwayBootstrapOptions } from '@midwayjs/core';
2
- export interface MockBootstrapOptions extends IMidwayBootstrapOptions {
1
+ import { ILifeCycle, IMidwayApplication, IMidwayBootstrapOptions } from '@midwayjs/core';
2
+ export interface MockBootstrapOptions extends IMidwayBootstrapOptions, ILifeCycle {
3
3
  cleanLogsDir?: boolean;
4
4
  cleanTempDir?: boolean;
5
5
  ssl?: boolean;
package/dist/legacy.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createLegacyLightApp = exports.createLegacyFunctionApp = exports.createLegacyApp = void 0;
3
+ exports.createLegacyApp = createLegacyApp;
4
+ exports.createLegacyFunctionApp = createLegacyFunctionApp;
5
+ exports.createLegacyLightApp = createLegacyLightApp;
4
6
  const creator_1 = require("./creator");
5
7
  const core_1 = require("@midwayjs/core");
6
8
  const functional_1 = require("@midwayjs/core/functional");
@@ -18,7 +20,6 @@ async function createLegacyApp(...args) {
18
20
  ];
19
21
  return (0, creator_1.createApp)(appDir, options);
20
22
  }
21
- exports.createLegacyApp = createLegacyApp;
22
23
  async function createLegacyFunctionApp(...args) {
23
24
  const appDir = typeof args[0] === 'string' ? args[0] : (args[0] ?? {}).appDir;
24
25
  const options = (typeof args[0] === 'string' ? args[1] : args[0]) ?? {};
@@ -33,7 +34,6 @@ async function createLegacyFunctionApp(...args) {
33
34
  ];
34
35
  return (0, creator_1.createFunctionApp)(appDir, options);
35
36
  }
36
- exports.createLegacyFunctionApp = createLegacyFunctionApp;
37
37
  async function createLegacyLightApp(...args) {
38
38
  const appDir = typeof args[0] === 'string' ? args[0] : (args[0] ?? {}).appDir;
39
39
  const options = (typeof args[0] === 'string' ? args[1] : args[0]) ?? {};
@@ -48,5 +48,4 @@ async function createLegacyLightApp(...args) {
48
48
  ];
49
49
  return (0, creator_1.createLightApp)(appDir, options);
50
50
  }
51
- exports.createLegacyLightApp = createLegacyLightApp;
52
51
  //# sourceMappingURL=legacy.js.map
package/dist/mock.js CHANGED
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mockContext = exports.restoreMocks = exports.restoreAllMocks = exports.mockProperty = exports.mockClassProperty = exports.mockHeader = exports.mockSession = void 0;
3
+ exports.mockSession = mockSession;
4
+ exports.mockHeader = mockHeader;
5
+ exports.mockClassProperty = mockClassProperty;
6
+ exports.mockProperty = mockProperty;
7
+ exports.restoreAllMocks = restoreAllMocks;
8
+ exports.restoreMocks = restoreMocks;
9
+ exports.mockContext = mockContext;
4
10
  const core_1 = require("@midwayjs/core");
5
11
  function getMockService(app) {
6
12
  if (!app) {
@@ -28,14 +34,12 @@ function mockSession(app, key, value, group = 'default') {
28
34
  ctx.session[key] = value;
29
35
  }, undefined, group);
30
36
  }
31
- exports.mockSession = mockSession;
32
37
  function mockHeader(app, headerKey, headerValue, group = 'default') {
33
38
  const mockService = getMockService(app);
34
39
  mockService.mockContext(app, (ctx) => {
35
40
  ctx.headers[headerKey] = headerValue;
36
41
  }, undefined, group);
37
42
  }
38
- exports.mockHeader = mockHeader;
39
43
  function mockClassProperty(clzz, propertyName, value, group = 'default') {
40
44
  const mockService = getMockService();
41
45
  if (!mockService) {
@@ -45,7 +49,6 @@ function mockClassProperty(clzz, propertyName, value, group = 'default') {
45
49
  return mockService.mockClassProperty(clzz, propertyName, value, group);
46
50
  }
47
51
  }
48
- exports.mockClassProperty = mockClassProperty;
49
52
  function mockProperty(obj, key, value, group = 'default') {
50
53
  const mockService = getMockService();
51
54
  if (!mockService) {
@@ -55,7 +58,6 @@ function mockProperty(obj, key, value, group = 'default') {
55
58
  return mockService.mockProperty(obj, key, value, group);
56
59
  }
57
60
  }
58
- exports.mockProperty = mockProperty;
59
61
  function restoreAllMocks() {
60
62
  const mockService = getMockService();
61
63
  if (mockService) {
@@ -65,17 +67,14 @@ function restoreAllMocks() {
65
67
  core_1.MidwayMockService.prepareMocks = [];
66
68
  }
67
69
  }
68
- exports.restoreAllMocks = restoreAllMocks;
69
70
  function restoreMocks(group = 'default') {
70
71
  const mockService = getMockService();
71
72
  if (mockService) {
72
73
  mockService.restore(group);
73
74
  }
74
75
  }
75
- exports.restoreMocks = restoreMocks;
76
76
  function mockContext(app, key, value, group = 'default') {
77
77
  const mockService = getMockService(app);
78
78
  mockService.mockContext(app, key, value, group);
79
79
  }
80
- exports.mockContext = mockContext;
81
80
  //# sourceMappingURL=mock.js.map
package/dist/utils.js CHANGED
@@ -6,7 +6,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.processArgsParser = exports.mergeGlobalConfig = exports.removeFile = exports.transformFrameworkToConfiguration = exports.findFirstExistModule = exports.isWin32 = exports.isTestEnvironment = void 0;
9
+ exports.isTestEnvironment = isTestEnvironment;
10
+ exports.isWin32 = isWin32;
11
+ exports.findFirstExistModule = findFirstExistModule;
12
+ exports.transformFrameworkToConfiguration = transformFrameworkToConfiguration;
13
+ exports.removeFile = removeFile;
14
+ exports.mergeGlobalConfig = mergeGlobalConfig;
15
+ exports.processArgsParser = processArgsParser;
10
16
  const core_1 = require("@midwayjs/core");
11
17
  const os = require("os");
12
18
  const assert = require("assert");
@@ -17,11 +23,9 @@ function isTestEnvironment() {
17
23
  testEnv.includes(process.env.EGG_SERVER_ENV) ||
18
24
  testEnv.includes(process.env.NODE_ENV));
19
25
  }
20
- exports.isTestEnvironment = isTestEnvironment;
21
26
  function isWin32() {
22
27
  return os.platform() === 'win32';
23
28
  }
24
- exports.isWin32 = isWin32;
25
29
  function findFirstExistModule(moduleList) {
26
30
  for (const name of moduleList) {
27
31
  if (!name)
@@ -34,7 +38,6 @@ function findFirstExistModule(moduleList) {
34
38
  }
35
39
  }
36
40
  }
37
- exports.findFirstExistModule = findFirstExistModule;
38
41
  /**
39
42
  * transform a framework component or framework module to configuration class
40
43
  * @param Framework
@@ -75,7 +78,6 @@ async function transformFrameworkToConfiguration(Framework, loadMode) {
75
78
  Framework,
76
79
  };
77
80
  }
78
- exports.transformFrameworkToConfiguration = transformFrameworkToConfiguration;
79
81
  async function removeFile(file) {
80
82
  try {
81
83
  await fs.promises.access(file, fs.constants.W_OK);
@@ -85,7 +87,6 @@ async function removeFile(file) {
85
87
  // ignore
86
88
  }
87
89
  }
88
- exports.removeFile = removeFile;
89
90
  function mergeGlobalConfig(globalConfig, newConfigObject) {
90
91
  if (globalConfig) {
91
92
  if (Array.isArray(globalConfig)) {
@@ -109,7 +110,6 @@ function mergeGlobalConfig(globalConfig, newConfigObject) {
109
110
  }
110
111
  return globalConfig;
111
112
  }
112
- exports.mergeGlobalConfig = mergeGlobalConfig;
113
113
  /**
114
114
  * 解析命令行参数的函数。
115
115
  * 它接受一个字符串数组作为输入,然后解析这个数组,
@@ -139,5 +139,4 @@ function processArgsParser(argv) {
139
139
  });
140
140
  return result;
141
141
  }
142
- exports.processArgsParser = processArgsParser;
143
142
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/mock",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.11",
4
4
  "description": "create your test app from midway framework",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -25,14 +25,14 @@
25
25
  "function.js"
26
26
  ],
27
27
  "engines": {
28
- "node": ">=12"
28
+ "node": ">=20"
29
29
  },
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
- "@midwayjs/core": "^4.0.0-beta.1",
33
- "@midwayjs/logger": "^3.0.0",
34
- "@types/amqplib": "0.10.6",
35
- "amqplib": "0.10.5",
32
+ "@midwayjs/core": "^4.0.0-beta.11",
33
+ "@midwayjs/logger": "^4.0.0",
34
+ "@types/amqplib": "0.10.8",
35
+ "amqplib": "0.10.9",
36
36
  "kafkajs": "2.2.4",
37
37
  "socket.io": "4.8.1",
38
38
  "socket.io-client": "4.8.1",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@types/superagent": "4.1.14",
43
43
  "@types/supertest": "2.0.16",
44
- "js-yaml": "4.1.0",
44
+ "js-yaml": "4.1.1",
45
45
  "raw-body": "2.5.2",
46
46
  "supertest": "6.3.3"
47
47
  },
@@ -50,5 +50,5 @@
50
50
  "type": "git",
51
51
  "url": "https://github.com/midwayjs/midway.git"
52
52
  },
53
- "gitHead": "832961ec3aff123c033197d8c00cb2bc9bad7ff8"
53
+ "gitHead": "6ef05719ca6e900f1ec34aff7a5c5a9614358c50"
54
54
  }