Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

React Native app for WMBR radio streaming (live + archives), schedules, and playlists.

## Genereal Guidelines

- Prefer code legibility over succinctness or robustness. A human will be
evaluating what you write, so write with that in mind.
- Err on the side of over-commenting. Again, a human will be reading your code,
and inline comments can help them to understand it.
- Always explain edits before you attempt to make them, so I can understand what
you're doing.
- When looking for files, please note:
- Imports are using aliases. Check tsconfig.json to see what they are.
- Imports commonly exclude the file extension. If an import refers to, for
instance, `@app/Page`, the actual file may be `src/app/Page.{ts,tsx}` or
`src/app/Page/index.{ts,tsx}`.
- Don't use the global `React` to access hooks or types; always import them
explicitly from 'react' (e.g. `import React, { useState } from 'react'`).
- Use variable names that are easy to understand. Avoid abbreviations, like `s`
for `state` or `p` for `progress`.

## Project Structure

- **App Shell & Tabs**: `src/app/index.tsx` (Bottom tab navigator + custom bar)
Expand Down
7 changes: 5 additions & 2 deletions __tests__/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ Render stacks/containers for navigation-dependent components. Example: prefer `r
## Async & Query Strategy

- Prefer `await screen.findBy*()` queries for async/network-driven elements; avoid manual `waitFor` for simple appearance checks.
- Use `userEvent` for interactions rather than `fireEvent`.
- Use `userEvent` for interactions rather than `fireEvent`, and import
`userEvent` from `@testing-library/react-native`, not from
`@testing-library/user-event`.
- Query preference: `getByRole` → `getByLabelText` → `getByText` → `getByTestId` (last).

## Mocks
Expand Down Expand Up @@ -117,8 +119,9 @@ if (urlStr.includes('alexandersimoes.com/get_playlist')) {

Run tests from the repository root using npx (avoid npm argument forwarding). For machine-readable output (best for an LLM), run one test file and produce a JSON result. For example, to test `RecentlyPlayed.test.tsx`:

````bash
```bash
npx jest __tests__/RecentlyPlayed.test.tsx --runInBand --json --testLocationInResults
```

---
Resources:
Expand Down