@midwayjs/mock 3.6.0 → 3.7.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/dist/creator.js +2 -3
- package/package.json +8 -8
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
|
|
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.
|
|
3
|
+
"version": "3.7.0",
|
|
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.
|
|
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.
|
|
35
|
-
"socket.io": "4.5.
|
|
36
|
-
"socket.io-client": "4.5.
|
|
34
|
+
"kafkajs": "2.2.2",
|
|
35
|
+
"socket.io": "4.5.3",
|
|
36
|
+
"socket.io-client": "4.5.3",
|
|
37
37
|
"ws": "8.9.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@midwayjs/async-hooks-context-manager": "^3.
|
|
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.
|
|
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": "
|
|
53
|
+
"gitHead": "99386083ee26b386fd508b9c892091c914e77535"
|
|
54
54
|
}
|