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
2 changes: 1 addition & 1 deletion .agents/skills/verify-codepush/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This skill covers bare RN only. The Expo variants (`test:setup:expo:*`, `test:fa
npm run setup # npm install + build:ts -> lib/
```
Run this again after every rebase or pull. Stale `node_modules` (for example an old TypeScript) makes `npm pack` fail in `build:ts` during `test:setup:*`, and the doctor does not detect it.
Mocha runs the `.mts` test sources directly (Node type-stripping), so tests need no build step. An edit to `test/*.mts` takes effect on the next run. `npm run typecheck:tests` (tslint + `tsc --noEmit`) is the only place type errors in `test/` get caught. The harness does not need the local `lib/`, because `npm pack` runs `prepare`, which builds `lib/` again.
Mocha runs the `.mts` test sources directly (Node type-stripping), so tests need no build step. An edit to `test/*.mts` takes effect on the next run. `npm run typecheck:tests` (`tsc --noEmit`) is the only place type errors in `test/` get caught. The harness does not need the local `lib/`, because `npm pack` runs `prepare`, which builds `lib/` again.

2. **Provision the test app.** Run one of these commands:
```
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:

- name: Lint and type-check
run: |
npm run lint
npm run typecheck
npm run typecheck:tests

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:

- name: Lint and type-check
run: |
npm run lint
npm run typecheck
npm run typecheck:tests

Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ CLAUDE.md
AGENTS.md
mise.toml
tsconfig.json
eslint.config.mjs
babel.config.js
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ React Native CodePush is a native module that enables over-the-air updates for R

Prefer unit testing what's possible (even though, on iOS, this involves a simulator). Legacy code used E2E tests for everything, which is complex, error-prone, and slow. The existing E2E tests are still useful, but this is not a pattern to follow.

#### Lint
- `npm run lint` (`lint:fix` to autofix)

#### E2E Tests
- `npm run typecheck:tests` - Lints and type-checks `test/`. Mocha runs the `.mts` test sources directly via Node's native TypeScript type-stripping, so this is the only place type errors in `test/` get caught.
- `npm run typecheck:tests` - Type-checks `test/`. Mocha runs the `.mts` test sources directly via Node's native TypeScript type-stripping, so this is the only place type errors in `test/` get caught.

Use the `verify-codepush` skill (`.agents/skills/verify-codepush/`) to run iOS and Android E2E tests and to prove a behavior end to end. It explains how the harness works, and how to drive and verify one CodePush behavior. Do not duplicate E2E details in this file.

Expand Down
19 changes: 19 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import bitrise from '@bitrise/eslint-plugin';

// The ported upstream tests in src/**/__tests__ are not part of any tsconfig yet, see "Testing Notes" in AGENTS.md.
const files = ['src/**/*.ts', 'test/**/*.mts'];
const ignores = ['src/**/__tests__/**'];

export default [
{ ...bitrise.react, files, ignores },
{
files,
ignores,
rules: {
// tsc already reports undefined identifiers, and no-undef misreads Node/mocha globals and type namespaces.
'no-undef': 'off',
// React Native has no stdout, so console is the logging channel.
'no-console': 'off',
},
},
];
Loading
Loading