tag: unit testing

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

Storage Fun with Forms Original vs Rebuilt: A Comparison
Maria D. Campbell
In this post, I compare the original Storage Fun with forms with the rebuilt one created with the help of Claude AI.
#macOS, #coverage, #istanbul, #jasmine standalone, #javascript, #tests, #unit testing, #vanilla template, #vite, #vite config, #vitest

Storage Fun with Forms Rebuilt: A Modern Pass with Claude Table of Contents
Maria D. Campbell
A table of contents of all posts in the Storage Fun with Forms rebuild series, covering Vite setup, Vitest testing, modularization, and a side-by-side comparison with the original build.
#macOS, #coverage, #istanbul, #jasmine standalone, #javascript, #rolldown, #series, #tests, #vanilla template, #vite, #vite config, #vitest, #unit testing

Storage Fun with Forms Rebuild: Testing the Code
Maria D. Campbell
Learn how to test your JavaScript code with Vitest and how to add code coverage to your vanilla JavaScript project using Istanbul and what it means.
#macOS, #coverage, #istanbul, #javascript, #series, #tests, #unit testing, #vanilla template, #vite, #vitest

Storage Fun with Forms: Working through the Code
Maria D. Campbell
In this post, I work through the Storage Fun with Forms JavaScript code and describe how I used Jasmine standalone to test for bugs.
#macOS, #jasmine standalone, #javascript, #series, #tests, #unit testing