Skip to content

Cannot find module 'gatsby-page-utils/apply-trailing-slash-option' from 'node_modules/gatsby-link/rewrite-link-path.js' #34803

Answered by LekoArts
m99coder asked this question in Help
Discussion options

You must be logged in to vote

In step 2 (https://www.gatsbyjs.com/docs/how-to/testing/unit-testing/#2-creating-a-configuration-file-for-jest) you need to make sure to set the moduleNameMapper correctly and include:

    "^gatsby-core-utils/(.*)$": `gatsby-core-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771
    "^gatsby-plugin-utils/(.*)$": [
      `gatsby-plugin-utils/dist/$1`,
      `gatsby-plugin-utils/$1`,
    ], // Workaround for https://github.com/facebook/jest/issues/9771

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@james-greenwood
Comment options

@saikojosh
Comment options

@YeminsonSanchez
Comment options

Answer selected by m99coder
Comment options

You must be logged in to vote
1 reply
@vripoche
Comment options

Comment options

You must be logged in to vote
2 replies
@sverrehu
Comment options

@jpgoelz
Comment options

Comment options

You must be logged in to vote
1 reply
@jpgoelz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
10 participants
Converted from issue

This discussion was converted from issue #34796 on February 12, 2022 15:35.