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

Ember 3.15 - Helper test always imports hbs from htmlbars-inline-precompile #18626

Closed
ijlee2 opened this issue Dec 22, 2019 · 1 comment · Fixed by #18691
Closed

Ember 3.15 - Helper test always imports hbs from htmlbars-inline-precompile #18626

ijlee2 opened this issue Dec 22, 2019 · 1 comment · Fixed by #18691

Comments

@ijlee2
Copy link
Member

ijlee2 commented Dec 22, 2019

Description

The blueprint for a helper test hardcoded the hbs import statement.

import hbs from 'htmlbars-inline-precompile';

https://github.com/emberjs/ember.js/blob/master/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js#L4

For Ember 3.15, which uses ember-cli-htmlbars ^4.2.0, I believe the blueprint would need to generate the line:

import { hbs } from 'ember-cli-htmlbars';

https://github.com/ember-cli/ember-cli-htmlbars#tagged-template-usage--migrating-from-htmlbars-inline-precompile

Proposed Solution

The blueprint for a component test shows how we can check the version of ember-cli-htmlbars in order to dynamically add the import statement:

https://github.com/emberjs/ember.js/blob/master/blueprints/component-test/index.js#L89-L97

https://github.com/emberjs/ember.js/blob/master/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js#L4

Please check both QUnit and Mocha.

@ijlee2 ijlee2 changed the title Ember 3.15 - Helper test still imports hbs from htmlbars-inline-precompile Ember 3.15 - Helper test always imports hbs from htmlbars-inline-precompile Dec 22, 2019
@rwjblue
Copy link
Member

rwjblue commented Dec 23, 2019

Yep, we should definitely fix! Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants