Skip to content

A Jest transform that compiles .pug files as template functions

License

Notifications You must be signed in to change notification settings

drastus/jest-transform-pug

 
 

Repository files navigation

jest-transform-pug

NPM dependencies Status devDependencies Status

A Jest transform that compiles your .pug files as template functions just like your pug loader would (e.g rollup-plugin-pug or pug-loader).

Usage

npm install jest-transform-pug --save-dev

Setup

Define jest-transform-pug as a transformer for Jest, by adding the following to your Jest configuration in your package.json:

{
  "jest": {
    "transform": {
      "\\.(pug)$": "jest-transform-pug"
    }
  }
}

Warning, this would override default transforms automatically set up by jest. Hence, if you rely on e.g., babel transpilation in your tests, you will need to set up babel jest as well:

{
  "jest": {
    "transform": {
      "^.+\\.jsx?$": "babel-jest",
      "\\.(pug)$": "jest-transform-pug"
    }
  }
}

About

A Jest transform that compiles .pug files as template functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%