1. jest-ts-webcompat-resolver
A resolver for Jest that handles TypeScript imports using a `.js` extension.
jest-ts-webcompat-resolver
Package: jest-ts-webcompat-resolver
Created by: AyogoHealth
Last modified: Fri, 06 May 2022 12:49:26 GMT
Version: 1.0.0
License: MIT
Downloads: 70,208
Repository: https://github.com/AyogoHealth/jest-ts-webcompat-resolver

Install

npm install jest-ts-webcompat-resolver
yarn add jest-ts-webcompat-resolver

Jest TypeScript Web-Compatible Resolver

TypeScript allows importing other TypeScript files with a .js extension, for
compatibility with the ES6 modules loader specification. Unfortunately, Jest
gets confused by this and complains that it's not able to find the JavaScript
file.

This is a resolver that catches that error, and then tries to resolve it again
but with a .ts extension.

Installation & Set-Up

Install this module into your project using npm:

npm install -D jest-ts-webcompat-resolver

Then add it to your Jest config file as the resolver:

"resolver": "jest-ts-webcompat-resolver"

Licence

This project is licensed under the MIT Licence.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin