Skip to content

GitHug/vue-jest-extended

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Fredrik Makila
Jun 6, 2021
4acee36 · Jun 6, 2021

History

27 Commits
Jun 6, 2021
Jun 6, 2021
Jun 6, 2021
Jul 22, 2019
Jun 6, 2021
Jun 6, 2021
Jul 22, 2019
Jul 22, 2019
Jun 6, 2021
Jun 6, 2021
Jul 28, 2019
Jun 6, 2021
Jun 6, 2021
Jun 6, 2021
Jun 6, 2021
Jun 6, 2021
Jun 6, 2021

Repository files navigation

Vue Jest Extended

Build Status dependencies Status devDependencies Status License: MIT

Jest extensions compatible with Vue Test Utils

⚠️ Designed to work with Vue 2.x ⚠️

Features

  • .toHaveEmitted - Check if a @vue/test-utils wrapper has emitted the given event
  • .toHaveEmittedPayload - Check if a @vue/test-utils has emitted an event with the given payload
  • .toExist - Pass if wrapper exists
  • .toBeVisible - Pass if wrapper is not visible

Install

yarn add -D vue-jest-extended

Setup

In your jest configuration:

From Jest v24

"jest": {
  ...
   "setupFilesAfterEnv": ["vue-jest-extended"]
  ...
}

Jest v23 or previous

"jest": {
  ...
  "setupTestFrameworkScriptFile": "vue-jest-extended"
  ...
}

alternatively if you want to combine these matchers with other matchers in your project

"jest": {
  ...
  "setupTestFrameworkScriptFile": "./extensions.js"
  ...
}
/* extensions.js */

import 'vue-jest-extended;
// require('vue-jest-extended);

License

MIT

About

Jest helper matchers compatible with vue-test-utils

Resources

License

Stars

Watchers

Forks

Packages

No packages published