Skip to content

Commit

Permalink
Merge pull request #33 from Reterics/develop/jest
Browse files Browse the repository at this point in the history
Added initial JEST config with test cases
  • Loading branch information
Shu12388y authored Oct 12, 2024
2 parents ae3cf72 + 8e3c4e8 commit f4a8f8e
Show file tree
Hide file tree
Showing 9 changed files with 7,614 additions and 2,986 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ yarn-error.log*
next-env.d.ts

# turbo
.turbo
.turbo

.idea
26 changes: 26 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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: './',
})

const config: Config = {
clearMocks: true,

collectCoverage: true,

coverageDirectory: "coverage",

// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
// The test environment that will be used for testing
testEnvironment: "jsdom",
setupFilesAfterEnv: ["./jest.setup.ts"],
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
},
};

export default createJestConfig(config);
1 change: 1 addition & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom'
Loading

0 comments on commit f4a8f8e

Please sign in to comment.