-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Create fourslash syntax, compiler testcase, and build instructions summary #61900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good. Also integrate the following content to the document:
- Run
hereby lint
andhereby format
before you're doneAdd commentMore actions - Only add testcases in
tests/cases/compiler
ortests/cases/fourslash
. Do not write direct unit tests. - Running a set of tests may take up to 4 minutes
- A full test run may take up to 15 minutes
- Maintainer comments in the issue should generally take priority over OP's comments
- Maintainers might give you hints on where to start. They are not always right, but a good place to start
Your workflow should be:
- Make a testcase that demonstrates the behavior. Run it (by itself) and review the baselines it generates to ensure it demonstrates the bug. Add the test and its baselines in one commit
- Fix the bug by changing code as appropriate. Put this fix in another commit
- Run the test you wrote again and ensure the baselines change in a way that demonstrates that the bug is fixed. Put this baseline diff in its own commit
- Run all other tests to ensure you didn't break anything. Some collateral baseline changes are normal, put these diffs in another commit
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Added all requested content including workflow guidelines, performance expectations, test location requirements, and the hereby format command. Changes committed in 870ec54. |
This PR creates a comprehensive guide for writing TypeScript tests to help Copilot understand how to write fourslash tests and compiler tests.
What's included
Created
.github/copilot-instructions.md
containing:Build Instructions Summary
hereby local
,hereby tests
,hereby runtests
, etc.)Fourslash Test Syntax Guide
/// <reference path='fourslash.ts'/>
////
/**/
and/*name*/
syntax for positioning// @Filename:
[|text|]
Compiler Test Syntax Guide
.ts
file structure intests/cases/compiler/
// @directive: value
Examples
Fourslash test example:
Compiler test example:
Focus on simplicity
The guide prioritizes:
The documentation has been tested against the actual codebase to ensure accuracy.
Fixes #61899.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.