Skip to content

Commit

Permalink
Merge pull request #117 from aiven/setup-frontend-testing
Browse files Browse the repository at this point in the history
Setup frontend testing
  • Loading branch information
SmuliS authored Oct 20, 2022
2 parents 0ce86c1 + a0f63c4 commit 857e051
Show file tree
Hide file tree
Showing 5 changed files with 2,272 additions and 60 deletions.
16 changes: 16 additions & 0 deletions coral/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

export default {
moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
preset: "ts-jest",
testEnvironment: "jsdom",
setupFilesAfterEnv: ['<rootDir>/test-setup/setup-files-after-env.ts'],
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg)$":
"jest-transform-stub",
"^@/(.*)$": "<rootDir>/src/$1",
},
};
13 changes: 12 additions & 1 deletion coral/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,31 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"test": "jest",
"preview": "vite preview",
"lint": "prettier --check src && eslint .",
"reformat": "prettier --write src"
"reformat": "prettier --write src",
"test-dev": "jest --watch"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@types/jest": "^29.2.0",
"@types/node": "*",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@types/testing-library__jest-dom": "^5.14.5",
"@vitejs/plugin-react": "^2.1.0",
"jest": "^29.2.1",
"jest-environment-jsdom": "^29.2.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.31.10",
Expand Down
Loading

0 comments on commit 857e051

Please sign in to comment.