-
-
Notifications
You must be signed in to change notification settings - Fork 381
Closed
Labels
Status: Need More InfoLacks enough info to make progressLacks enough info to make progress
Description
Reporting a bug?
After upgrade from 9.3.0-beta.27, the mock of useI18n() doesn't work:
import * as vueI18n from 'vue-i18n'
vi.spyOn(vueI18n, 'useI18n').mockReturnValue({})throws
Property 'mockReturnValue' does not exist on type 'never'.
Expected behavior
No error :)
Reproduction
- Create TypeScript project
npm install vue-i118n- Add a simple test
import { vi } from 'vitest' import * as vueI18n from 'vue-i18n' vi.spyOn(vueI18n, 'useI18n').mockReturnValue({})
npm run type-check
System Info
System:
OS: Windows 10 10.0.22621
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
Memory: 10.91 GB / 31.69 GB
Binaries:
Node: 20.0.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.5.0 - ~\AppData\Roaming\npm\pnpm.CMD
Browsers:
Edge: Spartan (44.22621.2134.0), Chromium (117.0.2045.36)
Internet Explorer: 11.0.22621.1Screenshot
No response
Additional context
Seems be a regression in #1309 7ebb0e4#diff-90783ef144f3a897c890355ff61bd08a99bbd36764128426b6f899a72e766f2eR803
Reverting line to previous version NonNullable<Options['locale']> seems fix the problem.
Like the test:type checks are still OK, probably the current typing is too strict? 🤔
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussions
Metadata
Metadata
Assignees
Labels
Status: Need More InfoLacks enough info to make progressLacks enough info to make progress