Skip to content

Commit

Permalink
[BUGFIX beta] Fix hbs import path
Browse files Browse the repository at this point in the history
/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 aa11b71
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 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 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupComponentTest } from 'ember-mocha';<% if (testType === 'integration') { %>
import hbs from 'htmlbars-inline-precompile';<% } %>
<%= hbsImportStatement %><% } %>

describe('<%= friendlyTestDescription %>', function() {
setupComponentTest('<%= componentPathName %>', {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import { describeComponent, it } from 'ember-mocha';<% if (testType === 'integration') { %>
import hbs from 'htmlbars-inline-precompile';<% } %>
<%= hbsImportStatement %><% } %>

describeComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { describe, it } from 'mocha';
import { setupRenderingTest } from 'ember-mocha';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
<%= hbsImportStatement %>

describe('<%= friendlyTestDescription %>', function() {
setupRenderingTest();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'integration') { %>
import hbs from 'htmlbars-inline-precompile';<% } %>
<%= hbsImportStatement %><% } %>

moduleForComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>', {
<% if (testType === 'integration' ) { %>integration: true<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
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 aa11b71

Please sign in to comment.