Releases: hmsk/jest-matcher-vue-test-utils
Releases · hmsk/jest-matcher-vue-test-utils
v2.0.0-0
- Support async function for the first argument of
toShow
,toHide
- Drop Jest 22 support
- Update devDependencies
Follow @types/jest 24.0.20
- Update typedef to follow the latest
@types/jest
, so you may see the type check errors if you use older@types/jest
- Update devDependencies
Show friendly diff when payload doesn't match
Pre: Friendly Diff
- Support friendly diff for unmatched payloads #146
- Update dependencies
v1.6.0
v1.5.2
- Refactoring file structure
- Update devDependencies
v1.5.1
- Remove unnecessary file
- Fix README
- Update devDependencies
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.10
Add new matchers: toDispatch, toHaveDispatched
New Matchers
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
});
Update dependencies
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.0
v1.4.0
- Support multiple payloads by toHaveEmitted d065487
- Support multiple arguments by toEmit Close #28 a1c0d7e
- Switch publishing manager to np on global 47bf300
- Merge pull request #27 from hmsk/renovate/vue-monorepo 3e9dfc8
- chore(deps): update vue monorepo to v2.6.6 7a12a3a
- Merge pull request #26 from hmsk/renovate/vue-monorepo 3c36382
- chore(deps): update vue monorepo to v2.6.5 bff0c82
v1.3.3
Changes from v1.3.0
Chore
- Separate some matchers to individual files
- Maintain README
Update devDependencies
- Node:
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