jest-transform-pug

1.0.0 • Public • Published

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"
    }
  }
}

Package Sidebar

Install

npm i jest-transform-pug

Weekly Downloads

478

Version

1.0.0

License

MIT

Unpacked Size

3.22 kB

Total Files

4

Last publish

Collaborators

  • quentinroy