Skip to content

Commit

Permalink
refactor code (community-related api endpoints)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinakar17 committed Jul 9, 2024
1 parent 550334b commit 2cb49e1
Show file tree
Hide file tree
Showing 40 changed files with 1,101 additions and 434 deletions.
18 changes: 18 additions & 0 deletions jest-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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
dir: './',
})

// Add any custom config to be passed to Jest
/** @type {import('jest').Config} */
const config = {
// Add more setup options before each test is run
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'jest-environment-jsdom',
preset: 'ts-jest',
}

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
module.exports = 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/extend-expect'
21 changes: 14 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand All @@ -13,7 +13,8 @@
"prettier": "prettier --write */**/*.{js,jsx,json,ts,tsx,scss,css,md}",
"prepare": "husky",
"generate-api": "npx orval",
"check-types": "tsc --noEmit"
"check-types": "tsc --noEmit",
"test": "jest"
},
"dependencies": {
"@headlessui/tailwindcss": "^0.2.1",
Expand Down Expand Up @@ -58,9 +59,8 @@
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@tailwindcss/forms": "^0.5.7",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/jest": "^29.5.12",
"@types/js-cookie": "^3.0.6",
"@types/node": "^20",
"@types/react": "^18",
Expand All @@ -73,8 +73,6 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.2.2",
"msw": "^2.3.0",
"orval": "^6.29.1",
Expand All @@ -83,6 +81,15 @@
"prettier-plugin-tailwindcss": "^0.5.14",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5"
"ts-node": "^10.9.2",
"typescript": "^5",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"eslint-plugin-jest-dom": "^5.0.2",
"eslint-plugin-testing-library": "^6.0.0",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"ts-jest": "^29.1.1"
}
}
Loading

0 comments on commit 2cb49e1

Please sign in to comment.