Skip to content

[docs] Add notes on naming of ts/react files and code coverage#1642

Open
andrewnicols wants to merge 1 commit into
moodle:mainfrom
andrewnicols:tsTestAndNaming
Open

[docs] Add notes on naming of ts/react files and code coverage#1642
andrewnicols wants to merge 1 commit into
moodle:mainfrom
andrewnicols:tsTestAndNaming

Conversation

@andrewnicols

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 21, 2026 03:22
@netlify

netlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploy Preview for moodledevdocs ready!

Name Link
🔨 Latest commit fd1f737
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/6a5ee6067711ef00084f23f6
😎 Deploy Preview https://deploy-preview-1642--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants