Skip to content

Commit db070f5

Browse files
committed
add Unit Unit and better typing
1 parent 845ce1e commit db070f5

18 files changed

Lines changed: 2947 additions & 326 deletions

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,24 @@ To quickly test FileFlow:
7878
4. **Upload and Insert**: Upload your CSV file and start the insertion process. Monitor progress with the on-screen
7979
loader.
8080

81+
## 🧪 Code Quality
82+
83+
### Unit Tests available
84+
85+
To run unit tests, use the following command:
86+
87+
```bash
88+
cargo test
89+
```
90+
91+
### Benchmarks available
92+
93+
To run benchmarks, use the following command:
94+
95+
```bash
96+
cargo bench
97+
```
98+
8199
## 🤝 Contributing
82100

83101
Contributions are welcome! To contribute:

jest.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
export default {
2+
preset: 'ts-jest/presets/default-esm',
3+
extensionsToTreatAsEsm: ['.ts', '.tsx'],
4+
testEnvironment: 'node',
5+
roots: ['<rootDir>/src'],
6+
testMatch: [
7+
'**/__tests__/**/*.+(ts|tsx|js)',
8+
'**/*.(test|spec).+(ts|tsx|js)'
9+
],
10+
transform: {
11+
'^.+\\.(ts|tsx)$': ['ts-jest', {
12+
useESM: true
13+
}]
14+
},
15+
moduleNameMapping: {
16+
'^(\\.{1,2}/.*)\\.js$': '$1'
17+
},
18+
collectCoverageFrom: [
19+
'src/**/*.{ts,tsx}',
20+
'!src/**/*.d.ts',
21+
'!src/**/*.test.{ts,tsx}'
22+
],
23+
coverageThreshold: {
24+
global: {
25+
branches: 90,
26+
functions: 90,
27+
lines: 90,
28+
statements: 90
29+
}
30+
}
31+
};

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
"dev": "vite",
88
"build": "tsc && vite build",
99
"preview": "vite preview",
10-
"tauri": "tauri"
10+
"tauri": "tauri",
11+
"test": "jest",
12+
"test:watch": "jest --watch",
13+
"test:coverage": "jest --coverage"
1114
},
1215
"dependencies": {
1316
"@radix-ui/react-checkbox": "^1.3.2",
@@ -49,6 +52,9 @@
4952
"postcss": "^8.5.4",
5053
"tailwindcss": "^3.4.17",
5154
"typescript": "^5.8.3",
52-
"vite": "^5.4.19"
55+
"vite": "^5.4.19",
56+
"@types/jest": "^29.5.0",
57+
"jest": "^29.5.0",
58+
"ts-jest": "^29.1.0"
5359
}
5460
}

0 commit comments

Comments
 (0)