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 3, 2023
1 parent 4545ba4 commit 6f7e3c3
Show file tree
Hide file tree
Showing 3 changed files with 9 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.1",
"@typescript-eslint/parser": "^5.59.1",
"@vitest/expect": "^0.30.1",
"esbuild": "^0.17.18",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
Expand Down
3 changes: 3 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.x.x -- TODO
declare global {
namespace Vi {
interface Assertion extends ToBeAnnouncedMatchers {}
Expand Down

0 comments on commit 6f7e3c3

Please sign in to comment.