Skip to content

CodingDive/jest-unexpected-token-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Problem description

In a CRA project, I was always getting the error unexpected token issue when rendering a component with React-testing-library. The component was loading an external dependency which didn't get transpiled correctly. As can be seen in the package.json and described here, the fix was to use the --transformIgnorePattern as a CLI option. Hardcoding the option into the jest config of the package.json or inside an external jest.config.js file, didn't work for me.

About

Replication and fix of styled-component "TypeError: _macro.default.div is not a function" and jest "unexpected-token-issue" inside CRA + TypeScript project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors