From 3d3fff1fbca98fefe9f074831cd42080efe0a2ec Mon Sep 17 00:00:00 2001 From: literat Date: Mon, 14 Feb 2022 10:22:34 +0100 Subject: [PATCH] test: map gatsby-page-utils correctly for test cases * @see https://github.com/gatsbyjs/gatsby/discussions/34803 * @see https://github.com/facebook/jest/issues/9771 --- config/jest/config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/config/jest/config.js b/config/jest/config.js index 79dc1f7f..2712de7b 100644 --- a/config/jest/config.js +++ b/config/jest/config.js @@ -20,6 +20,7 @@ module.exports = { '.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy', '.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/tests/__mocks__/file-mock.js', + '^gatsby-page-utils/(.*)$': `gatsby-page-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771 }, // An array of regexp pattern strings that are matched against all test paths before executing the test