Units test for VueX based on Jest.
The test coverage is as follows (for comparison purposes, the complete branch logic is intentionally not added):
The unit tests for VueX are mainly divided into getters, mutations and actions.
-
Babel related ecological library (@babel/core,@babel/plugin-transform-modules-commonjs,babel-jest) - specific function introduction please visit official website orawesome-url。
-
jest-localstoarge-mock - Simulate the localStorage related API in jest.
-
vue-jest - vue test plugin for jest.
-
vue-test-actions - A very convenient function for testing actions in VueX.