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: .github/instructions/astro.instructions.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,3 +6,10 @@ applyTo: "docs/**/*.astro"
6
6
7
7
- Always use TypeScript for type safety.
8
8
- Always put script in a separate file and import it.
9
+
10
+
## Testing Astro Components
11
+
12
+
- When testing Astro components, use the Astro Container API instead of manual HTML fixtures.
13
+
- This ensures tests stay in sync with component changes automatically.
14
+
- Reference: [Astro Container API Documentation](https://docs.astro.build/en/reference/container-reference/)
15
+
- Note: The Container API may not work reliably in jsdom/vitest environments. For unit tests focused on JavaScript behavior (not component rendering), consider generating minimal test HTML instead.
0 commit comments