@midwayjs/mock 3.6.0 → 3.7.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.
Files changed (2) hide show
  1. package/dist/creator.js +2 -3
  2. package/package.json +9 -9
package/dist/creator.js CHANGED
@@ -188,7 +188,7 @@ async function createFunctionApp(baseDir = process.cwd(), options = {}, customFr
188
188
  }
189
189
  // new mode
190
190
  const exports = options.starter.start(options);
191
- await exports[options.initializeMethodName || 'initializer']();
191
+ await exports[options.initializeMethodName || 'initializer'](options['initializeContext'] || {});
192
192
  const appCtx = options.starter.getApplicationContext();
193
193
  const configService = appCtx.get(core_1.MidwayConfigService);
194
194
  const frameworkService = appCtx.get(core_1.MidwayFrameworkService);
@@ -213,8 +213,7 @@ async function createFunctionApp(baseDir = process.cwd(), options = {}, customFr
213
213
  }
214
214
  const ctx = await framework.wrapHttpRequest(req);
215
215
  // create event and invoke
216
- const func = framework.getTriggerFunction(url.pathname);
217
- const result = await func(ctx, {
216
+ const result = await framework.getTriggerFunction(ctx, url.pathname, {
218
217
  isHttpFunction: true,
219
218
  originEvent: req,
220
219
  originContext: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/mock",
3
- "version": "3.6.0",
3
+ "version": "3.7.1",
4
4
  "description": "create your test app from midway framework",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -27,28 +27,28 @@
27
27
  },
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@midwayjs/core": "^3.6.0",
30
+ "@midwayjs/core": "^3.7.0",
31
31
  "@midwayjs/logger": "^2.15.0",
32
32
  "@types/amqplib": "0.8.2",
33
33
  "amqplib": "0.10.3",
34
- "kafkajs": "2.2.0",
35
- "socket.io": "4.5.2",
36
- "socket.io-client": "4.5.2",
37
- "ws": "8.9.0"
34
+ "kafkajs": "2.2.2",
35
+ "socket.io": "4.5.3",
36
+ "socket.io-client": "4.5.3",
37
+ "ws": "8.10.0"
38
38
  },
39
39
  "dependencies": {
40
- "@midwayjs/async-hooks-context-manager": "^3.6.0",
40
+ "@midwayjs/async-hooks-context-manager": "^3.7.0",
41
41
  "@types/superagent": "4.1.14",
42
42
  "@types/supertest": "2.0.12",
43
43
  "fs-extra": "10.0.1",
44
44
  "js-yaml": "4.1.0",
45
45
  "raw-body": "2.5.1",
46
- "supertest": "6.2.4"
46
+ "supertest": "6.3.0"
47
47
  },
48
48
  "author": "Harry Chen <czy88840616@gmail.com>",
49
49
  "repository": {
50
50
  "type": "git",
51
51
  "url": "http://github.com/midwayjs/midway.git"
52
52
  },
53
- "gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
53
+ "gitHead": "d41be2f6082d035ea4fb109e32b0e240c2435f9a"
54
54
  }