SitePoint
Blog
Forum
Library
Login
Join Premium
Toggle sidebar
Testing Vue.js Components with Jest
Toggle community discussions
Close
Content
Bookmarks
Preface
Testing Vue.js components with Jest
1
Write the first Vue.js Component Unit Test in Jest
Set up a vue-test sample project
Testing a Component
Testing a Component with vue-test-utils
Test Deeply Rendered Vue.js Components
Adding a Message Component
Testing MessageList with Message Component
Test Styles and Structure
The Wrapper object
Test Properties and Custom Events
Properties
Custom Events
Wrapping up
Test Computed Properties and Watchers
Computed Properties
Watchers
Wrapping Up
Test Methods and Mock Dependencies
Mock External Module Dependencies
Keep mocks externalized
Wrapping Up
Test Vue.js Slots
Make MessageList slot based
Testing Slots
Testing Named Slots
Testing Contextual Slot Specs
Wrapping
Enhance Jest configuration with Module Aliases
Webpack aliases
Multiple aliases
Other solutions
Wrapping Up
Snapshot Testing
Rethinking in Snapshots
When Snapshot Testing doesn’t help
When a test fails
Conclusion
Open text modal
Community Questions
Close