2021-12-25 10:44:24 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
import nextJest from 'next/jest'
|
|
|
|
|
|
|
|
const createJestConfig = nextJest({
|
|
|
|
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
|
2022-01-26 11:14:28 -05:00
|
|
|
dir: './'
|
2021-12-25 10:44:24 -05:00
|
|
|
})
|
|
|
|
|
|
|
|
// Add any custom config to be passed to Jest
|
|
|
|
const customJestConfig = {
|
2022-01-26 11:14:28 -05:00
|
|
|
setupFilesAfterEnv: [
|
|
|
|
'@testing-library/jest-dom/extend-expect'
|
|
|
|
],
|
2021-12-25 10:44:24 -05:00
|
|
|
moduleNameMapper: {
|
|
|
|
// Handle module aliases (this will be automatically configured for you soon)
|
2022-01-26 11:14:28 -05:00
|
|
|
'^@/components/(.*)$': '<rootDir>/src/components/$1',
|
2021-12-25 10:44:24 -05:00
|
|
|
},
|
2022-01-26 11:14:28 -05:00
|
|
|
roots: ["<rootDir>/src"],
|
2022-03-28 15:38:03 -04:00
|
|
|
testEnvironment: 'jsdom',
|
2021-12-25 10:44:24 -05:00
|
|
|
testPathIgnorePatterns: ["/node_modules/", "/cypress/"]
|
|
|
|
}
|
|
|
|
|
|
|
|
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
|
|
|
module.exports = createJestConfig(customJestConfig)
|