[BUGFIX] Fix runtime/lint errors in StrictResolver tests and add missing pluralizations#21403
Merged
NullVoxPopuli merged 5 commits intoMay 14, 2026
Conversation
The nested 'weird scenarios' module was using the QUnit global `module` instead of `QUnit.module`, which fails the `qunit/no-global-module-test` lint rule and also breaks the test bundle at runtime. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Use the global `QUnit` in the resolver test files instead of
`import * as QUnit from 'qunit'`. The vite virtual qunit module
only exports `q`, so the namespace import produces `{ q }` and
destructuring `test` / `module` from it yields `undefined`. This
caused "Uncaught TypeError: test is not a function" at script load
and prevented the entire test bundle from running. All other Ember
test files in this repo already use `QUnit` as a global.
- Add `helper` and `service` to `KNOWN_EASY_PLURALS`. The PR's tests
(resolves the standard ember types via default pluralization,
module paths with ./ prefix are normalized, etc.) expect
`service:foo -> services/foo` and `helper:foo -> helpers/foo`,
but the resolver was leaving them un-pluralized.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
module global lint error in StrictResolver basic-testThe generated app.js template iterates the outer scenarios' `project` parameter instead of its own inner `modules` parameter — at runtime in the app, `project` is undefined, so the smoke app crashes at load with `ReferenceError: project is not defined`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The PR adds @ember/engine/lib/strict-resolver.ts as a new entrypoint which is fully tree-shakable. Node.js Tests' tree-shakability snapshot needs to include it. This check was skipped on the PR's original CI because Basic Test failed first. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
\`compatModules\` from \`@embroider/virtual/compat-modules\` emits keys
shaped like \`<modulePrefix>/<rest>\` (e.g.
\`v2-app-template/routes/example-gjs-route\`). The strict resolver
expects \`./<rest>\` (or just \`<rest>\` — leading \`./\` is normalized
off).
The previous regex \`new RegExp(\`/\${config.modulePrefix}\\//\`)\`
was buggy two ways:
- In a template literal, \`\\/\` is just \`/\` (the backslash before a
slash is not an escape sequence in a string), so the pattern
actually was \`/<modulePrefix>//\` — a literal double slash.
- The leading slash required a slash before the prefix, but
compatModules' keys do not have one.
Together those meant the regex never matched any key, so the strict
resolver received \`<modulePrefix>/routes/example-gjs-route\` and
could not resolve \`route:example-gjs-route\`. The router then
threw \`UnrecognizedURLError\` on the smoke acceptance test.
Replace the regex with a plain \`startsWith\` / \`slice\` since the
modulePrefix can contain regex-special characters and a plain string
strip is unambiguous. This makes the \`strictResolver-basics\` smoke
test (both regular and Deprecations Removed variants) pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3378132
into
emberjs:nvp/strict-resolver-rfc-1132
41 checks passed
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.
Summary
PR #21303's
LintingandBasic TestCI jobs are failing on the same root cause: line 185 ofpackages/@ember/engine/tests/resolver/basic-test.jsuses the QUnit globalmodule(...)instead of the importedQUnit.module(...)used by the rest of the file.The fix is a one-line change to use
QUnit.module(...)consistently.Test plan
pnpm lintpasses locally (was failing only on this rule)pnpm build:jssucceeds locallyLintingjob passesBasic Testjob passes🤖 Generated with Claude Code