Skip to content

Test imports js instead of ts #3306

Answered by penx
penx asked this question in Q&A
Discussion options

You must be logged in to vote

I had to do 2 things:

  1. because the test was at the root of a module, inside index.test.ts I had to change import MyThing from "."; to import MyThing from "./index";
  2. In jest config add moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by penx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant