From 05c40cbb49d90f26c3a4db4c582bed1faf1af4cf Mon Sep 17 00:00:00 2001 From: Ricardo van der Heijden <20791917+ricardovdheijden@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:31:49 +0200 Subject: [PATCH] 1008 Updates config to include nextjs-jest config --- jest.config.cjs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jest.config.cjs b/jest.config.cjs index 5f74d6c5..49e4c5d7 100644 --- a/jest.config.cjs +++ b/jest.config.cjs @@ -1,6 +1,17 @@ const base = require('@orchestrator-ui/jest-config/jest-base.config.js'); +const nextJest = require('next/jest'); -module.exports = { +const createJestConfig = nextJest({ + // Provide the path to your Next.js app to load next.config.js and .env files in your test environment + dir: './', +}); + +// The entry for "uuid" in the moduleNameMapper can be removed when EUI updates the dependency version to 9.0.0 or higher. +// https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md#900-2022-09-05 +const customJestConfig = { ...base, displayName: 'Wfo-UI Tests', + moduleNameMapper: { "^uuid$": "uuid" }, }; + +module.exports = createJestConfig(customJestConfig);