jest-remove-path-extension
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

jest-remove-path-extension

Jest transformation plugin to remove path extension.

🌟 Excellent if you use .js in TypeScript files and Jest cannot find the module.

Usage

One plugin

Add to jest.config.js / package.json with files that you want to remove extensions from.

module.exports = {
  transform: {
    ".(ts|tsx)": ["jest-remove-path-extension", [".js"]],
  },
};

Of course, you can specify specific files for individual fixes.

Multiple plugins

Use jest-chain-transform, for example.

module.exports = {
  transform: {
    ".(ts|tsx)": [
      "jest-chain-transform",
      {
        transformers: [["jest-remove-path-extension", [".js"]], ["ts-jest"]],
      },
    ],
  },
};

If the plugin doesn't work

Run this command before running tests: npx jest --clearCache

Readme

Keywords

Package Sidebar

Install

npm i jest-remove-path-extension

Weekly Downloads

0

Version

0.2.0

License

Apache-2.0

Unpacked Size

13.6 kB

Total Files

6

Last publish

Collaborators

  • ilvetrov