Comments (2)
Doesn't "Mock exported class implementation" on the same page you listed already cover it?
from vitest.
I'm proposing that the documentation be updated to include examples of how to mock not just an instance of a class, but a single method, or a static method, or all instances of a class, etc., to cover all of the OO/class things can be mocked.
(And sorry for the delay in responding. I appreciate that you responded quickly. :-) )
from vitest.
Related Issues (20)
- False negative with typecheck enabled HOT 5
- (v2) `Error: Failed to load url` when dynamic importing js files generated during tests with relative path HOT 6
- Istanbul: Coverage ignore doesn't work for default in switch HOT 5
- Type error on mockImplementation with call signature in object type HOT 3
- Vitest failing to bundle nested dependency while Vite succeeds HOT 2
- Scoped Fixtures HOT 2
- Vitest v2 reports zero coverage for types-only TypeScript files HOT 7
- Vitest v2 coverage is reporting 'Unexpected reserved word' error HOT 4
- [@vitest/web-worker] Cannot acces the crypto API from vitest web worker HOT 1
- Coverage report does not include types-only TS files HOT 1
- Global coverage threshold should not exclude glob based thresholds HOT 1
- Support 100 shorthand option for pattern based coverage rules HOT 1
- Istanbul failing to report coverage for CJS requires HOT 3
- Vitest Startup Error HOT 5
- File system mocking example doesn't work
- Terminal UI flickering HOT 1
- Bug Report: userEvent click causing test timeout in Vitest but works in Jest HOT 4
- TypeScript errors when mocking overloaded functions
- Bug: `testNamePattern` option unnecessarily requires a leading space for an exact match.
- Cannot read properties of undefined (reading 'navigator') when using `@vitest/browser` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitest.