Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Test suite fails to run using ember-source v4.4.1 #20110

Closed
ndekeister-us opened this issue Jun 4, 2022 · 6 comments · Fixed by #20114
Closed

[Bug] Test suite fails to run using ember-source v4.4.1 #20110

ndekeister-us opened this issue Jun 4, 2022 · 6 comments · Fixed by #20114

Comments

@ndekeister-us
Copy link

ndekeister-us commented Jun 4, 2022

🐞 Describe the Bug

Using ember-source v4.4.1, when we generate a component and run the test suite, we will have the following error

Died on test #1: Could not find module `ember-test-ember-4-4/tests/helpers` imported from `dummy/tests/integration/components/foo-test`

In fact, it seems to fails when we try to import any files from my-addon-name/tests/helpers/*

Note that it was working on ember-source v4.3.0 because test files were generated with import { setupRenderingTest } from 'ember-qunit';, but using import { setupRenderingTest } from 'my-addon-name/tests/helpers'; in ember-source v4.3.0 we have the same error than above.

🔬 Minimal Reproduction

npm uninstall -g ember-cli && npm install -g ember-cli
ember addon ember-test-ember_4_4 && cd ember-test-ember_4_4
ember g component foo && ember test

https://github.com/ndekeister-us/ember-test-ember_4_4

😕 Actual Behavior

Using latest version of ember-source v4.4.1, it fails to run the test suite because it fails to import files in my-addon/tests/helpers/*

🤔 Expected Behavior

Using latest version of ember-source, i'm able to run the test suite

🌍 Environment

  • Ember: 4.4.1
  • Node.js/npm: 14.17.6/8.4.0
  • OS: Mac
  • Browser: Chrome
@bertdeblock
Copy link
Member

@ndekeister-us What's your ember-cli version?

@ndekeister-us
Copy link
Author

@bertdeblock

Tested with ember-cli 4.3 and 4.4, maybe linked to https://github.com/emberjs/ember.js/pull/19981/files ?

Using import { setupRenderingTest } from 'my-addon/tests/helpers'; in an addon seems to look for ./addon/tests/helpers instead of ./tests/helpers

If we move ./tests/helpers/index.js to ./addon/tests/helpers/index.js it will find the file when running test suite

@bertdeblock
Copy link
Member

I think that's a huge oversight on my part when implementing that RFC. I will try to fix ASAP (prob on monday). Sorry for the inconvenience!

@bertdeblock
Copy link
Member

The import path for addons should actually be import { setupRenderingTest } from 'dummy/tests/helpers';.

@ndekeister-us
Copy link
Author

import { setupRenderingTest } from 'dummy/tests/helpers';

+1 working great, will use this on my project until the patch

and thanks for implementing that RFC 🎉

@bertdeblock
Copy link
Member

Small update. I'm working on fixing this. I'm just adding some extra tests, to make sure I don't introduce any regressions.

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 a pull request may close this issue.

2 participants