@midwayjs/mock 3.7.1 → 3.7.3

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 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'](options['initializeContext'] || {});
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);
package/dist/mock.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { IMidwayApplication, IMidwayContext } from '@midwayjs/core';
2
- export declare function mockSession(app: IMidwayApplication, key: string, value: any): void;
3
- export declare function mockHeader(app: IMidwayApplication, headerKey: string, headerValue: string): void;
2
+ export declare function mockSession(app: IMidwayApplication<any>, key: string, value: any): void;
3
+ export declare function mockHeader(app: IMidwayApplication<any>, headerKey: string, headerValue: string): void;
4
4
  export declare function mockClassProperty(clzz: new (...args: any[]) => any, propertyName: string, value: any): void;
5
5
  export declare function mockProperty(obj: any, key: string, value: any): void;
6
6
  export declare function restoreAllMocks(): void;
7
- export declare function mockContext(app: IMidwayApplication, key: string | ((ctx: IMidwayContext) => void), value?: PropertyDescriptor | any): void;
7
+ export declare function mockContext(app: IMidwayApplication<any>, key: string | ((ctx: IMidwayContext) => void), value?: PropertyDescriptor | any): void;
8
8
  //# sourceMappingURL=mock.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/mock",
3
- "version": "3.7.1",
3
+ "version": "3.7.3",
4
4
  "description": "create your test app from midway framework",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -50,5 +50,5 @@
50
50
  "type": "git",
51
51
  "url": "http://github.com/midwayjs/midway.git"
52
52
  },
53
- "gitHead": "d41be2f6082d035ea4fb109e32b0e240c2435f9a"
53
+ "gitHead": "8e6c830bca52818e0086873b542423d16e609aef"
54
54
  }