Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

davidmyersdev/vue-jest

Open more actions menu
 
 

Repository files navigation

vue-jest

Jest Vue transformer for Vue 3.

Usage

npm install --save-dev vue-jest
yarn add --dev vue-jest

Setup

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

{
  "jest": {
    "transform": {
      "^.+\\.vue$": "vue-jest"
    }
}

Example Projects

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

TODO: Examples

Supported langs

vue-jest compiles the script and template of SFCs into a JavaScript file that Jest can run.

Supported script languages

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

Supported template languages

  • pug (lang="pug")

    • To give options for the Pug compiler, enter them into the Jest configuration. The options will be passed to pug.compile().
    {
      "jest": {
        "globals": {
          "vue-jest": {
            "pug": {
              "basedir": "mybasedir"
            }
          }
        }
      }
    }

Global Jest options

You can change the behavior of vue-jest by using jest.globals.

TODO:

  • Style support
  • Custom blocks
  • Global config

About

Jest Vue transformer

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 74.3%
  • Vue 22.4%
  • TypeScript 2.2%
  • SCSS 0.4%
  • Less 0.2%
  • Pug 0.2%
  • Other 0.3%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.