Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-vue

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-vue

Jest Vue transform

  • 0.8.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jest-vue

Jest Vue transformer with source map support

DEPRECATED

this package has been renamed to vue-jest

You can download vue-jest with the following command:

npm install --save-dev vue-jest

Usage

npm install --save-dev jest-vue

Setup

To define jest-vue as a transformer for your .vue files, you need to map .vue files to the jest-vue module.

"transform": {
  ".*\\.(vue)$": "<rootDir>/node_modules/jest-vue"
},

To use source maps, you need to set mapCoverage to true. A full config will look like this.

{
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "vue"
    ],
    "transform": {
      "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
      ".*\\.(vue)$": "<rootDir>/node_modules/jest-vue"
    },
    "mapCoverage": true
  }
}

Example Projects

Example repositories testing Vue components with jest and jest-vue:

  • Avoriaz with Jest
  • Vue Test Utils with Jest

Supported langs

jest-vue compiles the script and template of SFCs into a JavaScript file that Jest can run. It does not currently compile the style section.

Supported script languages

  • typescript (lang="ts", lang="typescript")
  • coffeescript (lang="coffee", lang="coffeescript")

Supported template languages

  • pug (lang="pug")
  • jade (lang="jade")

Keywords

FAQs

Package last updated on 24 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc