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
docs: update AGENTS.md with test262, changeset, and bugfix workflow guidance (#20659)
- Add test262-cases to test directories and test commands table
- Clarify changeset descriptions should not use fix:/feat: prefix
- Add test-first workflow note for bug fixes
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Copy file name to clipboardExpand all lines: AGENTS.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,8 @@ If your change involves modifying or adding webpack configuration options:
33
33
34
34
Modify source code in `lib/` as needed. If step 1 was performed, the latest type definitions are already available.
35
35
36
+
For bug fixes, consider writing the test case (step 3) first. Run the test to confirm it fails, reproducing the bug. Then make the code change and re-run the test — a passing test confirms the fix.
37
+
36
38
### 3. Writing Tests
37
39
38
40
Test files live in `test/` with naming conventions:
@@ -51,22 +53,24 @@ Test files live in `test/` with naming conventions:
51
53
-`test/hotCases/` — HMR (Hot Module Replacement) test cases
52
54
-`test/benchmarkCases/` — Performance benchmark cases (each has `index.js` + `webpack.config.mjs` + optional `options.mjs` with `setup()`)
53
55
-`test/*.unittest.js` — Unit tests using Jest directly (e.g., `test/FileSystemInfo.unittest.js` uses `memfs` for filesystem mocking)
56
+
-`test/test262-cases/` — ECMAScript test262 conformance cases (git submodule, init with `git submodule update --init test/test262-cases`; test runner: `test/test262.spectest.js`)
54
57
55
58
### 4. Running Tests
56
59
57
60
Only run tests when test files are modified or explicitly requested.
58
61
59
62
**Choose test command based on modified directory:**
You can add `--testNamePattern="<case-name>"` to run only specific test cases for faster validation. Multiple patterns can be combined with `|`. For example, if you only modified `test/configCases/css/basic/`:
72
76
@@ -87,7 +91,7 @@ Every user-facing change needs a changeset file:
87
91
Description of the change.
88
92
```
89
93
90
-
Use `patch` for bug fixes, `minor` for new features, `major` for breaking changes.
94
+
Use `patch` for bug fixes, `minor` for new features, `major` for breaking changes. Do not prefix the description with `fix:`, `feat:`, etc. — the change type is already indicated by `patch`/`minor`/`major`.
0 commit comments