jest-handlebars
Version:
A Jest processor that compiles included handlebars templates
27 lines (21 loc) • 573 B
Markdown
for handlebars files, that compiles the handlebars template and returns the render function.
```
npm i jest-handlebars --save-dev
```
To enable the processor please add the following rule to the `transform` object in your jest configuration:
```js
"jest": {
// ...
transform: {
"\\.hbs$": "jest-handlebars",
}
// ...
}
```
Now all imported handlebars files will get compiled by the processor and the render function is imported.
Johannes Pichler
MIT
This package contains a Jest processor