mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-12-22 09:13:19 +01:00
fix jest config
This commit is contained in:
parent
8f8bb23789
commit
fbd2094ec3
2
package-lock.json
generated
2
package-lock.json
generated
@ -48,7 +48,7 @@
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20"
|
||||
"node": "^20.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
|
@ -17,7 +17,7 @@
|
||||
"lint:css": "stylelint ./src/**/*.css",
|
||||
"lint": "npm run lint:js && npm run lint:css",
|
||||
"format": "prettier --write 'src/**/*.{ts,tsx,css}'",
|
||||
"jest": "jest --coverage -c tests/jest.config.ts",
|
||||
"jest": "jest --coverage -c tests/jest.config.js",
|
||||
"test": "NODE_ENV=test npm run prebuild && npm run lint && npm run typecheck && npm run jest",
|
||||
"new": "node --import tsx/esm ./scripts/new.ts",
|
||||
"favicon": "node --import tsx/esm ./scripts/favicon.ts",
|
||||
|
@ -1,17 +1,13 @@
|
||||
import nextJest from 'next/jest'
|
||||
import type { Config } from 'jest'
|
||||
import nextJest from 'next/jest.js'
|
||||
|
||||
const createJestConfig = nextJest({
|
||||
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
|
||||
dir: './'
|
||||
})
|
||||
|
||||
// Add any custom config to be passed to Jest
|
||||
const customJestConfig: Config = {
|
||||
rootDir: '../', // = /
|
||||
// Add more setup options before each test is run
|
||||
/** @type {import('jest').Config} */
|
||||
const customJestConfig = {
|
||||
rootDir: '../',
|
||||
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.tsx'],
|
||||
// if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
|
||||
moduleDirectories: ['node_modules', '<rootDir>/src'],
|
||||
testEnvironment: 'jsdom',
|
||||
moduleNameMapper: {
|
Loading…
Reference in New Issue
Block a user