Skip to content

MDL-88812 [docs] add JavaScript unit testing guide for React components#1603

Open
meirzamoodle wants to merge 1 commit into
moodle:mainfrom
meirzamoodle:MDL-88812_docs
Open

MDL-88812 [docs] add JavaScript unit testing guide for React components#1603
meirzamoodle wants to merge 1 commit into
moodle:mainfrom
meirzamoodle:MDL-88812_docs

Conversation

@meirzamoodle
Copy link
Copy Markdown
Contributor

Adds docs/guides/javascript/react/testing.md covering:

  • Running tests with npm test and grunt jsconfig pretest dependency
  • Project structure: jest.config.js, tsconfig.jest.json, .jest/globalSetup.ts
  • Where to place test files (/esm/tests//*.test.{ts,tsx})
  • Mocking AMD modules with mockAmdModule() and the ESM-layer testing pattern
  • Mocking language strings with mockString() and the default fallback behaviour
  • CommonJS mode rationale (no --experimental-vm-modules required)
  • core/amd coverage exclusion
  • Module path alias resolution
  • CI integration

Also updates the React index page to reference the new testing guide.

Adds docs/guides/javascript/react/testing.md covering:
- Running tests with npm test and grunt jsconfig pretest dependency
- Project structure: jest.config.js, tsconfig.jest.json, .jest/globalSetup.ts
- Where to place test files (**/esm/tests/**/*.test.{ts,tsx})
- Mocking AMD modules with mockAmdModule() and the ESM-layer testing pattern
- Mocking language strings with mockString() and the default fallback behaviour
- CommonJS mode rationale (no --experimental-vm-modules required)
- core/amd coverage exclusion
- Module path alias resolution
- CI integration

Also updates the React index page to reference the new testing guide.
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 2, 2026

Deploy Preview for moodledevdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit befa66d
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/6a1e2c2b77e75f00082902a8
😎 Deploy Preview https://deploy-preview-1603--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.

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.

1 participant