Skip to content

Commit

Permalink
fix: app.mockContext() should return egg context instance
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Feb 8, 2025
1 parent 64173de commit faf09f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eggjs/mock",
"version": "6.0.6",
"version": "6.0.6-beta.3",
"publishConfig": {
"access": "public"
},
Expand Down
6 changes: 4 additions & 2 deletions src/app/extend/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { isAsyncFunction, isObject } from 'is-type-of';
import { mock, restore } from 'mm';
import type { HttpClient } from 'urllib';
import { Transport, Logger, LoggerLevel, LoggerMeta } from 'egg-logger';
import { EggCore, EggCoreOptions, Context } from '@eggjs/core';
import { EggCore, type EggCoreOptions, type Context as EggCoreContext } from '@eggjs/core';
import type { Context as EggContext } from 'egg';
import { getMockAgent, restoreMockAgent } from '../../lib/mock_agent.js';
import {
createMockHttpClient, MockResultFunction,
Expand Down Expand Up @@ -39,7 +40,8 @@ export interface MockContextData {
[key: string]: any;
}

export interface MockContext extends Context {
// @ts-expect-error ignore type error
export interface MockContext extends EggContext, EggCoreContext {
service: any;
}

Expand Down

0 comments on commit faf09f9

Please sign in to comment.