Skip to content

jest package import assets issues #2906

Answered by merceyz
wdfinch asked this question in Q&A
Discussion options

You must be logged in to vote

Jest is hiding the real error, if you run PNP_DEBUG_LEVEL=1 yarn test you'll see this error:

✖ Your application tried to access identity-obj-proxy, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.

  In ← 'identity-obj-proxy'
  In ← 'C:\\workspaces-jest\\package/'
  In ← { extensions: [ '.js', '.json', '.jsx', '.ts', '.tsx', '.node' ] }

The fix is to resolve the mapping up front

diff --git a/app/jest.config.js b/app/jest.config.js
index 31ca6db..eb2411f 100644
--- a/app/jest.config.js
+++ b/app/jest.config.js
@@ -4,7 +4,7 @@ const config = {
   displayName: 'react-flow-builder',
   moduleNameMapper: {
     "\\.(jpg|jpeg|png|gif|eot|otf|webp|s…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@merceyz
Comment options

merceyz May 18, 2021
Collaborator

@wdfinch
Comment options

@SimenB
Comment options

Answer selected by wdfinch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants