tag: branch coverage

Mocking localStorage in Vitest with jsdom: Chasing 100% Branch Coverage
Maria D. Campbell
How I mocked localStorage across five Vitest test files with jsdom, and used coverage isolation to figure out which of two near-identical tests was actually forcing 100% branch coverage.
#javascript, #jsdom, #localStorage, #tests, #unit testing, #vite, #vitest, #mocking, #branch coverage, #doMock, #spyOn