jest-matcher-vue-test-utils

✨ Cute jest matchers to test Vue components with vue-test-utils

Downloads
370
Stars
33
Committers
4
jest-matcher-vue-test-utils - Latest Release

Published by hmsk over 3 years ago

jest-matcher-vue-test-utils -

Published by hmsk almost 4 years ago

jest-matcher-vue-test-utils -

Published by hmsk almost 4 years ago

jest-matcher-vue-test-utils -

Published by hmsk almost 4 years ago

jest-matcher-vue-test-utils -

Published by hmsk almost 4 years ago

jest-matcher-vue-test-utils -

Published by hmsk almost 4 years ago

jest-matcher-vue-test-utils - v2.1.0-0

Published by hmsk over 4 years ago

  • Follow newer vue-test-utils (beta 32+) requirements
    • Fix typedefs to support functional components (on toShow, toHide)
    • Accept the deprecation warnings for contains(), use find().exists()
    • Allow wrapper.trigger may return Promise (tests on toDispatch)
  • Update devDependencies

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.0.1...v2.1.0-0

jest-matcher-vue-test-utils - v2.0.1

Published by hmsk over 4 years ago

  • Fix typedef to run with TS 3.9 correctly
  • Update dependencies, especially jest, ts-jest

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.0.0...v2.0.1

jest-matcher-vue-test-utils - v2.0.0: Support asynchronous operations

Published by hmsk over 4 years ago

Breaking Change

  • Jest 22 is no longer supported (Requires Jest 23+ in peerDependency)

New Features

  • toShow, toHide, toEmit, and toDispatch support asynchronous operations

Others

  • Update devDependencies
  • Remove the deprecated badge by Dev Protocols

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.8.0...v2.0.0

jest-matcher-vue-test-utils -

Published by hmsk over 4 years ago

  • Support async function for the first argument of toEmit
  • Use equals from expect module directly
  • Update devDependencies

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v2.0.0-0...v2.0.0-1

jest-matcher-vue-test-utils -

Published by hmsk almost 5 years ago

  • Support async function for the first argument of toShow, toHide
  • Drop Jest 22 support
  • Update devDependencies

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.8.0...v2.0.0-0

jest-matcher-vue-test-utils - Follow @types/jest 24.0.20

Published by hmsk almost 5 years ago

  • Update typedef to follow the latest @types/jest, so you may see the type check errors if you use older @types/jest
  • Update devDependencies

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.7.0...v1.8.0

jest-matcher-vue-test-utils - Show friendly diff when payload doesn't match

Published by hmsk about 5 years ago

  • Support friendly diff for unmatched payloads #146
  • Update dependencies

image

image

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.6.0...v1.7.0

jest-matcher-vue-test-utils - Pre: Friendly Diff

Published by hmsk about 5 years ago

  • Support friendly diff for unmatched payloads #146
  • Update dependencies

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.6.0...v1.7.0-0

jest-matcher-vue-test-utils -

Published by hmsk over 5 years ago

  • Allow any version of jest after 22
  • Provide proper type definition for Vuex plugin

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.5.2...v1.6.0

Thanks for your contributions

  • @sobolevn #97 #98
jest-matcher-vue-test-utils -

Published by hmsk over 5 years ago

  • Refactoring file structure
  • Update devDependencies

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.5.1...v1.5.2

jest-matcher-vue-test-utils -

Published by hmsk over 5 years ago

  • Remove unnecessary file
  • Fix README
  • Update devDependencies
    • rollup: 1.6.0 -> 1.7.0
    • typescript: 3.3.3333 -> 3.3.4000
    • vue: 2.6.9 -> 2.6.10
    • vue-template-compiler: 2.6.9 -> 2.6.10

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.5.0...v1.5.1

jest-matcher-vue-test-utils - Add new matchers: toDispatch, toHaveDispatched

Published by hmsk over 5 years ago

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.0
  • rollup-plugin-commonjs: 9.2.0 -> 9.2.1
  • rollup-plugin-json: 3.1.0 -> 4.0.0
  • rollup-plugin-node-resolve: 4.0.0 -> 4.0.1
  • rollup-plugin-typescript2: 0.19.1 -> 0.20.1
  • typescript: 3.3.3 -> 3.3.3333
  • vue: 2.6.6 -> 2.6.9
  • vue-jest: 3.0.3 -> 3.0.4
  • vue-template-compiler: 2.6.6 -> 2.6.9
  • vuex: Added 3.1.0

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.4.0...v1.5.0

jest-matcher-vue-test-utils -

Published by hmsk over 5 years ago

  • 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

https://github.com/hmsk/jest-matcher-vue-test-utils/compare/v1.3.3...v1.4.0

jest-matcher-vue-test-utils - v1.3.3

Published by hmsk over 5 years ago

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
Package Rankings
Top 6.75% on Npmjs.org
Badges
Extracted from project README
npm GitHub Workflow Status