You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/app/lib/utils/__tests__/README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ This directory contains tests for the FileApi utility class.
4
4
5
5
## Overview
6
6
7
-
The tests use Vitest as the testing framework, which provides excellent TypeScript support and works well with Vite-based projects like SvelteKit.
7
+
The tests use Vitest as the testing framework, which provides excellent TypeScript support and works
8
+
well with Vite-based projects like SvelteKit.
8
9
9
10
## Setup
10
11
@@ -62,7 +63,8 @@ The `file.test.ts` file contains comprehensive tests for the `listNotes` method,
62
63
63
64
## Mocking Strategy
64
65
65
-
The tests mock the Tauri `invoke` function to simulate backend responses without requiring the actual Rust backend to be running. This allows for:
66
+
The tests mock the Tauri `invoke` function to simulate backend responses without requiring the
67
+
actual Rust backend to be running. This allows for:
66
68
67
69
- Fast test execution
68
70
- Predictable test results
@@ -71,7 +73,8 @@ The tests mock the Tauri `invoke` function to simulate backend responses without
71
73
72
74
## Test Data
73
75
74
-
The tests use realistic mock data that matches the expected structure of `NoteInfo` objects returned by the Rust backend, including:
76
+
The tests use realistic mock data that matches the expected structure of `NoteInfo` objects returned
77
+
by the Rust backend, including:
75
78
76
79
- File paths with various formats
77
80
- Realistic file sizes and timestamps
@@ -80,4 +83,5 @@ The tests use realistic mock data that matches the expected structure of `NoteIn
80
83
81
84
## Error Testing
82
85
83
-
The error handling tests ensure that the `FileApi.handleError` method properly normalizes different error types into consistent `AppError` objects, maintaining type safety throughout the application.
86
+
The error handling tests ensure that the `FileApi.handleError` method properly normalizes different
87
+
error types into consistent `AppError` objects, maintaining type safety throughout the application.
0 commit comments