Skip to content

Docs: Document how to run the QUnit test suite#12699

Open
lancewillett wants to merge 1 commit into
WordPress:trunkfrom
lancewillett:docs/readme-qunit-tests
Open

Docs: Document how to run the QUnit test suite#12699
lancewillett wants to merge 1 commit into
WordPress:trunkfrom
lancewillett:docs/readme-qunit-tests

Conversation

@lancewillett

@lancewillett lancewillett commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Documents how to run the JavaScript QUnit test suite from a fresh checkout.

This adds the qunit:compiled command, which builds the required files before running the suite. It also explains the build prerequisite for running qunit directly.

Trac ticket: https://core.trac.wordpress.org/ticket/65719

Use of AI Tools

AI assistance: Yes
Tool(s): OpenAI Codex
Model(s): GPT-5
Used for: Drafting, applying, and validating the documentation update under contributor direction.

Copilot AI review requested due to automatic review settings July 26, 2026 23:11
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props lancewillett.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Documents how to run WordPress Core’s JavaScript QUnit test suite from a fresh checkout by pointing contributors to the qunit:compiled Grunt task and explaining the build prerequisite for running QUnit directly.

Changes:

  • Adds README instructions for running QUnit tests via qunit:compiled.
  • Explains why running qunit directly requires pre-built assets in build/.
Comments suppressed due to low confidence (1)

README.md:109

  • This paragraph mixes npx grunt … with a bare grunt build, which can be confusing (and may not work if grunt isn’t on PATH). It’s also more precise to mention copy:qunit, since qunit:compiled runs it.
`qunit:compiled` builds first, then runs the suite. The QUnit runner loads
scripts from the built `build/` directory, so a plain `npx grunt qunit`
requires a completed `grunt build` first—without a build, every test fails
with a `jQuery is not defined` error.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Copilot AI review requested due to automatic review settings July 26, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

README.md:108

  • For consistency with the suggested command above (and to avoid implying a different invocation path), this reference should also use npm run grunt instead of npx grunt.
`qunit:compiled` builds first, then runs the suite. The QUnit runner loads
scripts from the built `build/` directory, so a plain `npx grunt qunit`
requires a completed `npm run build` first—without a build, every test fails

README.md:103

  • Use the existing npm script wrapper for Grunt (package.json scripts has "grunt": "grunt") to keep the README consistent with other commands here and with CI (.github/workflows/reusable-javascript-tests.yml runs npm run grunt qunit:compiled).
npx grunt qunit:compiled

Copilot AI review requested due to automatic review settings July 26, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Adds a README.md section explaining how to run the JavaScript QUnit test suite from a fresh checkout, using `npm run grunt qunit:compiled` to build required files before running the suite. Documents why running `npm run grunt qunit` directly without a prior `npm run build` fails with a `jQuery is not defined` error, since the QUnit runner loads scripts from the built `build/` directory.

Fixes #65719.

Props lance.willett@automattic.com
@lancewillett
lancewillett force-pushed the docs/readme-qunit-tests branch from d6bcf8c to ab747e0 Compare July 27, 2026 02:05
Comment thread README.md

`qunit:compiled` builds first, then runs the suite. The QUnit runner loads
scripts from the built `build/` directory, so a plain `npm run grunt qunit`
requires a completed `npm run build` first—without a build, every test fails

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
requires a completed `npm run build` firstwithout a build, every test fails
requires a completed `npm run build` first without a build, every test fails

Nit

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.

3 participants