Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

jest-nunjucks

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-nunjucks

Jest processor that compiles nunjucks templates

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Build Status

jest-nunjucks

Jest processor that compiles nunjucks templates

Install

npm i jest-nunjucks --save-dev

Config example

Add to your config

"jest": {
    "transform": {
        "^.+\\.njk$": "jest-nunjucks",
    }
}

To use nunjucks configuration options just add them into global jest config

"jest": {
  "globals": {
    "nunjucks": {
      "config": {
        "throwOnUndefined": true,
        "trimBlocks": true
      }
    }
  },
  "transform": {
    "^.+\\.njk$": "jest-nunjucks"
  }
}

To use set path to look for templates use root option, it will be resolved with jest <rootDir>. If it's unset path for templates will be - <rootDir>;

"jest": {
  "globals": {
    "nunjucks": {
      "root": "./path-to-root-dir",
      "config": {
        "throwOnUndefined": true,
        "trimBlocks": true
      }
    }
  },
  "transform": {
    "^.+\\.njk$": "jest-nunjucks"
  }
}

License

MIT

Keywords

jest

FAQs

Package last updated on 15 Nov 2018

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