mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
feat(tests): add unit tests for accounts and transactions APIs
- Updated package.json to include Vitest for testing and added necessary devDependencies. - Created accounts.test.ts to test the accounts API endpoints for listing and retrieving accounts. - Implemented setup.ts to reset test data before each test run. - Developed transactions.test.ts to cover creating, updating, and deleting transactions through the API. - Added vitest.config.ts for configuring Vitest with appropriate settings and coverage options.
This commit is contained in:
21
vitest.config.ts
Normal file
21
vitest.config.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference types="vitest" />
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
// Increase timeout for slower CI environments
|
||||
testTimeout: 10000,
|
||||
// Use the setup file we created
|
||||
setupFiles: ["./src/test/setup.ts"],
|
||||
// Ensure we're using the right environment
|
||||
environment: "node",
|
||||
// Only include test files
|
||||
include: ["src/test/**/*.{test,spec}.{ts,js}"],
|
||||
// Configure coverage collection
|
||||
coverage: {
|
||||
provider: "v8",
|
||||
reporter: ["text", "json", "html"],
|
||||
exclude: ["node_modules/", "src/test/**/*", "**/*.d.ts"],
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user