Skip to content

Commit b0c7373

Browse files
committed
fixup! docs: document running tests without sharding in AGENTS.md
1 parent ae28874 commit b0c7373

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎AGENTS.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ This is the source code for the Angular CLI and related build tooling. This guid
2222
pnpm build --local
2323
```
2424

25+
## Coding Practices
26+
27+
- **Imports:**
28+
- Always use the `node:` protocol for Node.js built-in imports (e.g., `node:fs`, `node:path`, `node:assert`).
29+
- Prefer named imports (e.g., `import { mkdtemp } from 'node:fs'`) or default imports (`import fs from 'node:fs'`) instead of namespace imports (`import * as fs`).
30+
- Use type-only imports (`import type { ... }`) when importing types to avoid runtime side-effects.
31+
- **Classes:**
32+
- Prefer ECMAScript private fields (`#field`) over TypeScript `private` keywords for encapsulated state.
33+
2534
## Testing
2635

2736
- **Temporary Directories (`TEST_TMPDIR`):**
@@ -42,9 +51,6 @@ This is the source code for the Angular CLI and related build tooling. This guid
4251
});
4352
```
4453
- **NEVER** use or fallback to `os.tmpdir()`. Bazel executes tests in hermetic sandboxes and sets `TEST_TMPDIR` to an isolated, sandboxed directory. Using `os.tmpdir()` can cause sandboxing failures, permission errors, or file leakage outside the Bazel sandbox.
45-
- **Imports:**
46-
- Always use the `node:` protocol for Node.js built-in imports (e.g., `node:fs`, `node:path`, `node:assert`).
47-
- Prefer named imports (e.g., `import { mkdtemp } from 'node:fs'`) or default imports (`import fs from 'node:fs'`) instead of namespace imports (`import * as fs`).
4854
- **Unit Tests:**
4955
- Run all unit tests: `pnpm bazel test //packages/...`
5056
- Run a specific test target: `pnpm bazel test //packages/angular/build:test`

0 commit comments

Comments
 (0)