Skip to content

Commit 870ec54

Browse files
Add workflow guidelines and test requirements per maintainer feedback
Co-authored-by: RyanCavanaugh <[email protected]>
1 parent 214d145 commit 870ec54

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

.github/copilot-instructions.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ hereby runtests --runner=compiler # Run only compiler tests
2222
hereby runtests --tests=<testPath> # Run specific test
2323
hereby baseline-accept # Accept new test baselines
2424
hereby lint # Run eslint
25+
hereby format # Run code formatting
2526
```
2627

2728
## Fourslash Test Syntax Guide
@@ -256,4 +257,38 @@ hereby runtests --tests=tests/cases/compiler/abstractClassUnionInstantiation.ts
256257
hereby runtests --tests=tests/cases/fourslash/completion*.ts
257258
```
258259

259-
This guide focuses on the most common and idiomatic patterns for writing TypeScript tests. For complex scenarios, refer to existing tests in the codebase for additional patterns and techniques.
260+
## Important Guidelines
261+
262+
### Test Locations
263+
- Only add testcases in `tests/cases/compiler` or `tests/cases/fourslash`
264+
- Do not write direct unit tests as they are almost never the correct test format for our repo
265+
266+
### Performance Expectations
267+
- Running a set of tests may take up to 4 minutes
268+
- A full test run may take up to 15 minutes
269+
- Always run `hereby lint` and `hereby format` before you're done
270+
271+
### Working with Issues
272+
- Maintainer comments in the issue should generally take priority over OP's comments
273+
- Maintainers might give you hints on where to start. They are not always right, but a good place to start
274+
275+
## Recommended Workflow
276+
277+
When fixing bugs or implementing features, follow this workflow:
278+
279+
1. **Make a testcase that demonstrates the behavior**
280+
- Run it (by itself) and review the baselines it generates to ensure it demonstrates the bug
281+
- Add the test and its baselines in one commit
282+
283+
2. **Fix the bug by changing code as appropriate**
284+
- Put this fix in another commit
285+
286+
3. **Run the test you wrote again**
287+
- Ensure the baselines change in a way that demonstrates that the bug is fixed
288+
- Put this baseline diff in its own commit
289+
290+
4. **Run all other tests to ensure you didn't break anything**
291+
- Some collateral baseline changes are normal
292+
- Put these diffs in another commit
293+
294+
All fixes should use one of these two test formats. Do not use unit tests as they are almost never the correct test format for our repo.

0 commit comments

Comments
 (0)