[docs] Add notes on naming of ts/react files and code coverage#1642
Open
andrewnicols wants to merge 1 commit into
Open
[docs] Add notes on naming of ts/react files and code coverage#1642andrewnicols wants to merge 1 commit into
andrewnicols wants to merge 1 commit into
Conversation
✅ Deploy Preview for moodledevdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Moodle DevDocs to make TypeScript/React file naming and Jest testing/coverage expectations more discoverable, and adds a dedicated React “Coding conventions” page that centralises the policy.
Changes:
- Added a new React “Coding conventions” page documenting TS/TSX file naming and the 80% Jest coverage requirement.
- Added “tests required / 80% coverage” callouts and links to the conventions page from broader policy/coding-style docs.
- Updated the React guide index and testing guide “See also” sections to link to the new conventions page.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| general/development/policies/codingstyle/index.md | Adds a JS/TS section pointing to the JS + React guides and the unit-testing policy. |
| general/development/policies.md | Adds an explicit TS/TSX naming + Jest coverage requirement under JavaScript policies. |
| docs/guides/javascript/react/testing.md | Adds a “Tests are required” callout and links to the new conventions page. |
| docs/guides/javascript/react/index.md | Adds a new “Coding conventions” section and link to the new conventions page. |
| docs/guides/javascript/react/conventions.md | New page documenting TS/TSX file naming rules and Jest coverage/testing requirements. |
Comment on lines
+33
to
+36
| All new TypeScript and TSX code **must** be accompanied by Jest unit tests, with a minimum of **80% coverage** of the new code (statements, branches, functions, and lines). Pull requests which add TypeScript or TSX code without corresponding tests, or which fall below this coverage threshold, will not be accepted. | ||
|
|
||
| Use `npm test -- --coverage` to check coverage locally before submitting a pull request. See [Collecting coverage](./testing.md#running-tests) in the testing guide. | ||
|
|
Comment on lines
+18
to
+21
| ## Coding conventions | ||
|
|
||
| All new TypeScript and TSX code must follow Moodle's file naming conventions, and must be accompanied by Jest unit tests with a minimum of 80% coverage. See the [coding conventions](./conventions.md) page for details. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.