Skip to content

Commit

Permalink
refactor: rename fun name
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryven committed Feb 15, 2023
1 parent bd4edc7 commit 2be7e07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vitest/src/runtime/mocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export class VitestMocker {
return this.executor.moduleCache
}

private deleteModuleCache(id: string) {
private deleteCachedItem(id: string) {
const mockId = this.getMockPath(id)
if (this.moduleCache.get(mockId))
if (this.moduleCache.has(mockId))
this.moduleCache.delete(mockId)
}

Expand Down Expand Up @@ -298,7 +298,7 @@ export class VitestMocker {
if (mock && id in mock)
delete mock[id]

this.deleteModuleCache(id)
this.deleteCachedItem(id)
}

public mockPath(originalId: string, path: string, external: string | null, factory?: MockFactory) {
Expand All @@ -313,7 +313,7 @@ export class VitestMocker {

this.mockMap.set(suitefile, mocks)
this.resolveCache.set(suitefile, resolves)
this.deleteModuleCache(id)
this.deleteCachedItem(id)
}

public async importActual<T>(rawId: string, importee: string): Promise<T> {
Expand Down

0 comments on commit 2be7e07

Please sign in to comment.