Install via NPM with babel-jest
, which this module depends.
npm i -D babel-jest riot-v6-jest-transformer
Edit jest.config.js or something like this.
module.exports = {
moduleFileExtensions: [
"js",
"riot",
],
transform: {
"^.+\\.js$": "babel-jest",
"^.+\\.riot$": "./lib/index.js"
}
}
This module requires babel environment.
You need to prepare for your own.
Install modules.
npm i -D @babel/core @babel/preset-env
Edit .babelrc.
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current",
},
},
],
]
}
Remember to set "@babel/preset-typescript" with allowExtension
if you use TypeScript in your tags.
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current",
},
},
],
[
"@babel/preset-typescript",
{
"allExtensions": true,
}
]
]
}