Skip to content

Commit

Permalink
fix: support new vitest typings
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed May 4, 2023
1 parent bd3a7d0 commit ca50958
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@types/node": "^18.16.3",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"@vitest/expect": "^0.30.1",
"esbuild": "^0.17.18",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
Expand Down
25 changes: 25 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/vitest/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ interface ToBeAnnouncedMatchers {
toBeAnnounced(politenessSetting?: Exclude<PolitenessSetting, 'off'>): void;
}

declare module '@vitest/expect' {
interface Assertion extends ToBeAnnouncedMatchers {}
}

// For Vitest below 0.31.x
declare global {
namespace Vi {
interface Assertion extends ToBeAnnouncedMatchers {}
Expand Down

0 comments on commit ca50958

Please sign in to comment.