Skip to content

Commit

Permalink
[BUGFIX beta] Fix hbs import path
Browse files Browse the repository at this point in the history
This is currently broken on the Octane blueprint:

```
/home/travis/build/ember-learn/super-rentals-tutorial/dist/code/super-rentals/super-rentals/tests/integration/components/jumbo-test.js: Only `import { hbs } from 'ember-cli-htmlbars'` is supported. You used: `import hbs from 'ember-cli-htmlbars';`
  2 | import { setupRenderingTest } from 'ember-qunit';
  3 | import { render } from '@ember/test-helpers';
> 4 | import hbs from 'ember-cli-htmlbars';
    | ^
  5 |
  6 | module('Integration | Component | jumbo', function(hooks) {
  7 |   setupRenderingTest(hooks);
```
  • Loading branch information
chancancode committed Sep 20, 2019
1 parent ef889a3 commit 20746cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions blueprints/component-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ module.exports = useTestFrameworkDetector({
componentPathName = [options.path, dasherizedModuleName].filter(Boolean).join('/');
}

let inlinePrecompileModule = this._useSeparateInlinePrecompileAddon()
? 'htmlbars-inline-precompile'
: 'ember-cli-htmlbars';
let hbsImportStatement = this._useSeparateInlinePrecompileAddon()
? "import hbs from 'htmlbars-inline-precompile';"
: "import { hbs } from 'ember-cli-htmlbars';";

let templateInvocation = invocationFor(options);
let componentName = templateInvocation;
Expand All @@ -82,7 +82,7 @@ module.exports = useTestFrameworkDetector({
closeComponent,
selfCloseComponent,
friendlyTestDescription,
inlinePrecompileModule,
hbsImportStatement,
};
},

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if (testType === 'integration') { %>import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from '<%= inlinePrecompileModule %>';
<%= hbsImportStatement %>

module('<%= friendlyTestDescription %>', function(hooks) {
setupRenderingTest(hooks);
Expand Down

0 comments on commit 20746cc

Please sign in to comment.