JSPM

jest-kdu-preprocessor

1.1.0-alpha.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q14545F
  • License MIT

Preprocessor that allows importing of .kdu files in jest tests

Package Exports

  • jest-kdu-preprocessor
  • jest-kdu-preprocessor/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jest-kdu-preprocessor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jest-kdu-preprocessor

This package supports both ES6 (Babel) and TypeScript.

Portions both preprocessors are heavily based kduify (Copyright (c) 2021-present NKDuy).

Installation

  1. add package you your project
  • yarn add --dev jest-kdu-preprocessor or npm install --saveDev jest-kdu-preprocessor
  1. modify package.json's jest section by adding/editing moduleFileExtensions and transform properites:

    "jest": {
      "moduleFileExtensions": [
        "js",
        "kdu"
      ],
      "transform": {
        "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
        ".*\\.(kdu)$": "<rootDir>/node_modules/jest-kdu-preprocessor"
      }
    }
  2. Start writing test that can import *.kdu components - see example ./tests/index.spec.js

  3. Profit!

License: MIT