Skip to content

Conversation

@NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Jun 25, 2025

followup to: #64

Key changes:

  • tell vitest to not forward its env to our invoked ember-cli / test commands
  • add babel-plugin-debug-macros for @glimmer/env for DEBUG support (only for the dev/test babel.config)
  • in the tests/index.html, enable the embroider-macros sync of isTesting via importing @embroider/macros/src/vendor/embroider-macros-test-support

"c8": "^7.11.3",
"ember-cli": "github:ember-cli/ember-cli#master",
"execa": "^9.5.2",
"execa": "^9.6.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

could be PR'd separately

addonDir = join(tmpDir, addonName);
await execa({
cwd: tmpDir,
extendEnv: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

extendEnv is noise in this PR without an accompanying env: {} to set the env to empty

@mkszepp
Copy link
Contributor

mkszepp commented Dec 23, 2025

Would be nice to get this PR

In ember-basic-dropdown i have isTesting() in use, which isn't working right now without adding a workaround in test-helpers start() function

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/add-build-mode-tests branch from 8a895fd to da5827f Compare December 23, 2025 21:28
@NullVoxPopuli NullVoxPopuli changed the title Add build mode tests Add build mode tests (ensuring isDevelopingApp and isTesting are appropriately true when they need to be (as well as assert-stripping)) Dec 23, 2025
@mkszepp
Copy link
Contributor

mkszepp commented Jan 6, 2026

@NullVoxPopuli the fix of this branch works only partially...

I have an issue found out with ember-power-select and ember-basic-dropdown.
The ember-basic-dropdown addon has two isTesting() points (see here, this is the more critical point, when it stays false while testing).

When the ember-power-select is using the workaround from this branch, isTesting() is inside the ember-power-select addon true in test, but in ember-basic-dropdown code parts it's always false, which is not expected.

If you run this in ember app test (like ember-power-select docs), isTesting() is true, which is expected.

If you want test this issue, you can do this with following steps.

  1. Download ember-power-select (https://github.com/cibernox/ember-power-select)
  2. Run pnpm i
  3. Insert a console.log(isTesting()); in node_modules/ember-basic-dropdown/dist/components/basic-dropdown.js
  4. Run pnpm test on root or pnpm start with http://localhost:4200/tests

The isTesting() is always false and so all tests will normally fail. I have only added a workaround in eps, by setting destination (https://github.com/cibernox/ember-power-select/blob/master/tests/test-helper.ts#L51-L54, normaly this should not be needed)

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants