Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
geoperez committed Nov 8, 2023
1 parent af4e3b1 commit 35f8627
Show file tree
Hide file tree
Showing 10 changed files with 2,219 additions and 123 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: Build
name: Build and Report Sonar

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
uses: unosquare/bump-npm-version/.github/workflows/build-no-test.yml@master
uses: unosquare/bump-npm-version/.github/workflows/build-sonar.yml@master
secrets:
github-token: ${{ secrets.GPR_ACCESS_TOKEN }}
sonar-token: ${{ secrets.SONAR_TOKEN }}
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';
43 changes: 42 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
},
"devDependencies": {
"@rspack/cli": "^0.3.10",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.1.0",
"@types/jest": "^29.5.8",
"@types/object-hash": "^3.0.5",
"@types/react": "^18.2.34",
"@types/react-dom": "^18.2.14",
Expand All @@ -32,20 +35,58 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.0.2",
"object-hash": "^3.0.0",
"postcss-loader": "^7.3.3",
"prettier": "^3.0.3",
"tailwindcss": "^3.3.5",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"jest": {
"coverageReporters": [
"lcov",
"text"
],
"moduleFileExtensions": [
"js",
"ts",
"tsx"
],
"transform": {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"diagnostics": false,
"tsconfig": "tsconfig.json"
}
]
},
"testMatch": [
"<rootDir>/src/**/*.spec.tsx"
],
"coverageThreshold": {
"global": {
"branches": 74,
"functions": 85,
"lines": 90,
"statements": -80
}
},
"setupFilesAfterEnv": [
"<rootDir>/jest-setup.ts"
]
},
"scripts": {
"start": "rspack serve",
"watch": "tsc --watch",
"build": "tsc && npx ncp src/resources/ dist/resources",
"lint": "tsc --noEmit && eslint ./src/**/*.{ts,tsx}",
"lint:fix": "eslint ./src/**/*.{ts,tsx} --fix",
"test": "tsc --noEmit",
"test": "jest",
"cest": "jest --collectCoverage",
"prepare": "husky install"
},
"prettier": {
Expand Down
Loading

0 comments on commit 35f8627

Please sign in to comment.