-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #755 from ember-cli/ember-cli-test
Add a test that covers addon templates and fix ember-try to include correct ember-cli versions
- Loading branch information
Showing
8 changed files
with
2,395 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,13 +96,36 @@ module.exports = { | |
} | ||
|
||
this._addon.logger.debug(`setup *.hbs compiler with ${htmlbarsOptions.pluginNames}`); | ||
return debugTree( | ||
let output = debugTree( | ||
this._addon.transpileTree(inputTree, { | ||
isProduction, | ||
...htmlbarsOptions, | ||
}), | ||
'03-output' | ||
); | ||
|
||
let checker = new VersionChecker(this._addon.project).for('ember-cli', 'npm'); | ||
let requiresBabelTree = checker.lt('3.13.0'); | ||
let isAddon = this._addon.parent !== this._addon.project; | ||
|
||
// as a result of https://github.com/ember-cli/ember-cli-htmlbars/pull/749 we are relying | ||
// on babel for all template comilation. This works fine since [email protected] but before | ||
// that there was a different path for **addon** templates and they would not be compiled | ||
// correctly. This change wraps the output of addons in a babel tree since ember-cli | ||
// isn't doing that properly. | ||
if (requiresBabelTree && isAddon) { | ||
let babelAddon = this._addon.parent.addons.find( | ||
(addon) => addon.name === 'ember-cli-babel' | ||
); | ||
output = babelAddon.transpileTree(output, { | ||
babel: this._addon.parent.options.babel, | ||
'ember-cli-babel': { | ||
compileModules: false, | ||
}, | ||
}); | ||
} | ||
|
||
return output; | ||
}, | ||
|
||
precompile(string, _options) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit, currentURL } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
|
||
module('Acceptance | styleguide', function (hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
test('visiting /styleguide', async function (assert) { | ||
await visit('/styleguide'); | ||
|
||
assert.equal(currentURL(), '/styleguide'); | ||
|
||
assert.dom('[data-test-es-note-heading]').containsText('says...'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<EsNote>You should try out this cool note component</EsNote> |
Oops, something went wrong.