✨ Cute jest matchers to test Vue components with vue-test-utils
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v3.0.0-2...v3.0.0-3
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v3.0.0-1...v3.0.0-2
toHideInNextTick
toShowInNextTick
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v3.0.0-0...v3.0.0-1
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.1.0-2...v3.0.0-0
toEmitOnRoot
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.1.0-1...v2.1.0-2
toHaveEmittedOnRoot
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.1.0-0...v2.1.0-1
Published by hmsk over 4 years ago
toShow
, toHide
)contains()
, use find().exists()
wrapper.trigger
may return Promise (tests on toDispatch
)https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.0.1...v2.1.0-0
Published by hmsk over 4 years ago
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.0.0...v2.0.1
Published by hmsk over 4 years ago
toShow
, toHide
, toEmit
, and toDispatch
support asynchronous operationshttps://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.8.0...v2.0.0
toEmit
equals
from expect
module directlyhttps://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.0.0-0...v2.0.0-1
toShow
, toHide
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.8.0...v2.0.0-0
Published by hmsk almost 5 years ago
@types/jest
, so you may see the type check errors if you use older @types/jest
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.7.0...v1.8.0
Published by hmsk about 5 years ago
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.6.0...v1.7.0
Published by hmsk about 5 years ago
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.6.0...v1.7.0-0
jest
after 22https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.5.2...v1.6.0
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.5.1...v1.5.2
rollup
: 1.6.0 -> 1.7.0typescript
: 3.3.3333 -> 3.3.4000vue
: 2.6.9 -> 2.6.10vue-template-compiler
: 2.6.9 -> 2.6.10https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.5.0...v1.5.1
Published by hmsk over 5 years ago
toDispatch
Assert that a function dispatches specific Vuex action (with payload)
import Component from "./click-store.vue";
it("Dispatches the action on store by click", () => {
const wrapper = shallowMount(Component) expect(() => {
wrapper.trigger("click");
}).toDispatch(wrapper, "awesomeAction"); // Passes
expect(() => {
wrapper.trigger("click");
}).toDispatch(wrapper, "awesomeAction", 'click'); // Passes
});
toHaveDispatched
Assert that a component dispatched specific Vuex action (with payload)
import Component from "./click-store.vue";
import { vuexPlugin } from "jest-matcher-vue-test-utils";
it("Dispatches the action on store by click", () => {
const store = new Vuex.Store({
actions: dispatchStore() {},
plugins: [vuexPlugin()] // Requires adding plugin to use `toHaveDispatched` matcher
});
const wrapper = shallowMount(Component, { store })
wrapper.trigger("click");
expect(wrapper).toHaveDispatched("awesomeAction"); // Passes
expect(wrapper).toHaveDispatched("awesomeAction", "click"); // Passes
});
rollup
: 1.1.2 -> 1.6.0rollup-plugin-commonjs
: 9.2.0 -> 9.2.1rollup-plugin-json
: 3.1.0 -> 4.0.0rollup-plugin-node-resolve
: 4.0.0 -> 4.0.1rollup-plugin-typescript2
: 0.19.1 -> 0.20.1typescript
: 3.3.3 -> 3.3.3333vue
: 2.6.6 -> 2.6.9vue-jest
: 3.0.3 -> 3.0.4vue-template-compiler
: 2.6.6 -> 2.6.9vuex
: Added 3.1.0https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.4.0...v1.5.0
https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.3.3...v1.4.0
Published by hmsk over 5 years ago
Changes from v1.3.0
8.15
-> 10.15
typescript
: 3.2.4
-> 3.3.3
@types/jest
: 23.3.13
-> 23.3.14
@vue/test-utils
: 1.0.0-beta.28
-> 1.0.0-beta.29
vue
: 2.5.22
-> 2.6.4
vue-jest
: 3.0.2
-> 3.0.3
vue-template-compiler
: 2.5.22
-> 2.6.4