What problem does it solve?
Writing JavaScript tests for Discourse requires knowing its specific QUnit conventions, helper wrappers, module naming rules, and network stubbing patterns, which are easy to get wrong and cause flaky or inconsistent tests.
Core Features & Use Cases
- Test Structure Guidance: Covers unit tests with setupTest, component rendering tests with setupRenderingTest, and full acceptance tests with the acceptance() helper and needs configuration.
- Naming & Assertion Conventions: Enforces pipe-separated module naming (PascalCase for components, kebab-case for libs/services) and qunit-dom assertions via assert.dom.
- Network Stubbing & Fixtures: Explains pretender-based API stubbing, canned fixtures, and the qunit-helpers toolbox for users, MessageBus, fake time, and input simulation.
- Use Case: When adding a new component to a Discourse plugin, use this Skill to scaffold a .gjs rendering test with the correct module name, setupRenderingTest import, and pretender routes, then run it with bin/qunit.
Quick Start
Write a QUnit component rendering test for my Discourse plugin's new PollInfo component following the project conventions.