Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

karak/riot-v4-jest-transformer

Repository files navigation

Riot-v6-jest-transformer

Usage

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

Note

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,
      }
    ]
  ]
}

About

jest transformer for tags of riot v4

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published