Skip to content

Commit

Permalink
chore: fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Aug 13, 2024
1 parent 57d8fc4 commit 1bb340f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/browser/src/client/tester/unhandled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ function catchWindowErrors(cb: (e: ErrorEvent) => void) {
const removeEventListener = window.removeEventListener.bind(window)
window.addEventListener('error', throwUnhandlerError)
window.addEventListener = function (
...args: Parameters<typeof addEventListener>
...args: [any, any, any]
) {
if (args[0] === 'error') {
userErrorListenerCount++
}
return addEventListener.apply(this, args)
}
window.removeEventListener = function (
...args: Parameters<typeof removeEventListener>
...args: [any, any, any]
) {
if (args[0] === 'error' && userErrorListenerCount) {
userErrorListenerCount--
Expand Down
4 changes: 2 additions & 2 deletions packages/vitest/src/integrations/env/jsdom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ function catchWindowErrors(window: Window) {
const removeEventListener = window.removeEventListener.bind(window)
window.addEventListener('error', throwUnhandlerError)
window.addEventListener = function (
...args: Parameters<typeof addEventListener>
...args: [any, any, any]
) {
if (args[0] === 'error') {
userErrorListenerCount++
}
return addEventListener.apply(this, args)
}
window.removeEventListener = function (
...args: Parameters<typeof removeEventListener>
...args: [any, any, any]
) {
if (args[0] === 'error' && userErrorListenerCount) {
userErrorListenerCount--
Expand Down
7 changes: 7 additions & 0 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ export class Vitest {
this.getCoreWorkspaceProject().provide(key, value)
}

/**
* @deprecated internal, use `_createCoreProject` instead
*/
createCoreProject() {
return this._createCoreProject()
}

/**
* @internal
*/
Expand Down
3 changes: 1 addition & 2 deletions packages/vitest/src/typecheck/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
someTasksAreOnly,
} from '@vitest/runner/utils'
import type { File, Suite, Test } from '@vitest/runner'
import type { Node, TemplateLiteral } from 'estree'
import type { WorkspaceProject } from '../node/workspace'
import { generateCodeFrame } from '../node/error'

Expand Down Expand Up @@ -265,7 +264,7 @@ export async function collectTests(
}
}

function mergeTemplateLiteral(node: TemplateLiteral): string {
function mergeTemplateLiteral(node: any): string {
let result = ''
let expressionsIndex = 0

Expand Down

0 comments on commit 1bb340f

Please sign in to comment.