generated from NHSDigital/nhs-notify-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from NHSDigital/feature/CCM-5847_project_setup_…
…with_header CCM-5847: Add page header
- Loading branch information
Showing
53 changed files
with
10,286 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* For a detailed explanation regarding each configuration property, visit: | ||
* https://jestjs.io/docs/configuration | ||
*/ | ||
|
||
import type { Config } from 'jest'; | ||
import nextJest from 'next/jest.js'; | ||
import { pathsToModuleNameMapper } from 'ts-jest'; | ||
import { compilerOptions } from './tsconfig.json'; | ||
|
||
const createJestConfig = nextJest({ | ||
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment | ||
dir: './src', | ||
}); | ||
|
||
const config: Config = { | ||
preset: 'ts-jest', | ||
|
||
// Automatically clear mock calls, instances, contexts and results before every test | ||
clearMocks: true, | ||
|
||
// Indicates whether the coverage information should be collected while executing the test | ||
collectCoverage: true, | ||
|
||
// The directory where Jest should output its coverage files | ||
coverageDirectory: './.reports/unit/coverage', | ||
|
||
// Indicates which provider should be used to instrument code for coverage | ||
coverageProvider: 'v8', | ||
|
||
coverageThreshold: { | ||
global: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: -10, | ||
}, | ||
}, | ||
|
||
collectCoverageFrom: ['src/**/*.ts*'], | ||
|
||
coveragePathIgnorePatterns: [ | ||
'.types.ts', | ||
'layout.tsx', | ||
'container.tsx', | ||
'.snap', | ||
'app/create-template/page.tsx', // CCM-5752 | ||
], | ||
|
||
// Use this configuration option to add custom reporters to Jest | ||
reporters: [ | ||
'default', | ||
[ | ||
'./node_modules/jest-html-reporter', | ||
{ | ||
pageTitle: 'Test Report', | ||
outputPath: './.reports/unit/test-report.html', | ||
includeFailureMsg: true, | ||
}, | ||
], | ||
], | ||
|
||
// The test environment that will be used for testing | ||
testEnvironment: 'jsdom', | ||
|
||
testPathIgnorePatterns: ['/node_modules/', 'fixture', 'helpers.ts'], | ||
|
||
// Set the absolute path for imports | ||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { | ||
prefix: '<rootDir>/', | ||
}), | ||
|
||
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'], | ||
}; | ||
|
||
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async | ||
// https://nextjs.org/docs/app/building-your-application/testing/jest | ||
export default createJestConfig(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// https://nextjs.org/docs/app/building-your-application/testing/jest#optional-extend-jest-with-custom-matchers | ||
import '@testing-library/jest-dom'; | ||
import { TextEncoder, TextDecoder } from 'util'; | ||
|
||
Object.assign(global, { TextDecoder, TextEncoder }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
export default nextConfig; |
Oops, something went wrong.