feat(testing): add Vitest config, tests, and CI workflow#16
Merged
Conversation
Greptile SummaryThis PR adds Vitest testing infrastructure with CI workflow automation, but contains two critical path errors that will cause tests to fail immediately. The Key changes:
Confidence Score: 1/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant GH as GitHub Actions
participant Bun as Bun Runtime
participant Vitest as Vitest
participant Tests as Test Files
Dev->>GH: Push to main or open PR
GH->>Bun: Setup Bun runtime
GH->>Bun: bun install --frozen-lockfile
Bun->>Bun: Install dependencies (Vitest, happy-dom, jest-dom)
GH->>Bun: bun lint
Bun-->>GH: Biome lint results
GH->>Bun: bun typecheck
Bun-->>GH: TypeScript check results
GH->>Bun: bun test
Bun->>Vitest: Start Vitest runner
Vitest->>Vitest: Load vitest.config.ts
Vitest->>Vitest: Setup happy-dom environment
Vitest->>Tests: Load tests/setup.ts (jest-dom)
Vitest->>Tests: Run tests/lib/utils.test.ts
Tests-->>Vitest: cn() test results
Vitest->>Tests: Run tests/features/todo/schema.test.ts
Tests-->>Vitest: Schema validation test results
Vitest-->>Bun: Aggregated test results
Bun-->>GH: Test summary
GH-->>Dev: CI status (pass/fail)
|
| plugins: [tsconfigPaths()], | ||
| test: { | ||
| environment: "happy-dom", | ||
| setupFiles: ["./src/test/setup.ts"], |
There was a problem hiding this comment.
syntax: setupFiles path is incorrect - the file is at ./tests/setup.ts, not ./src/test/setup.ts
Suggested change
| setupFiles: ["./src/test/setup.ts"], | |
| setupFiles: ["./tests/setup.ts"], |
Prompt To Fix With AI
This is a comment left during a code review.
Path: vitest.config.ts
Line: 8:8
Comment:
**syntax:** setupFiles path is incorrect - the file is at `./tests/setup.ts`, not `./src/test/setup.ts`
```suggestion
setupFiles: ["./tests/setup.ts"],
```
How can I resolve this? If you propose a fix, please make it concise.| createTodoSchema, | ||
| deleteTodoSchema, | ||
| updateTodoSchema, | ||
| } from "@/features/todos/types/todo-types"; |
There was a problem hiding this comment.
syntax: import path is incorrect - the schemas are in @/features/todos/schema, not @/features/todos/types/todo-types
Suggested change
| } from "@/features/todos/types/todo-types"; | |
| } from "@/features/todos/schema"; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/features/todo/schema.test.ts
Line: 6:6
Comment:
**syntax:** import path is incorrect - the schemas are in `@/features/todos/schema`, not `@/features/todos/types/todo-types`
```suggestion
} from "@/features/todos/schema";
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.