JSPM

  • Created
  • Published
  • Downloads 96781
  • Score
    100M100P100Q36462F
  • License MIT

Precompile inline HTMLBars templates via ES6 tagged template strings

Package Exports

  • ember-cli-htmlbars-inline-precompile

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ember-cli-htmlbars-inline-precompile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ember-cli-htmlbars-inline-precompile

Build Status

Precompile HTMLBars template strings within the tests of an Ember-CLI project via ES6 tagged template strings:

// ember-cli-project/test/unit/components/my-component-test.js
import hbs from 'htmlbars-inline-precompile';
import { moduleForComponent, test } from 'ember-qunit';

moduleForComponent('my-component');

test('it renders', function(assert) {
  var component = this.subject({
    greeting: "hello ember testing",
    layout: hbs`
      greeting: <span>{{greeting}}</span>
    `
  });

  assert.equal(this.$().html().trim(), "greeting: <span>hello ember testing</span>");
});

where the addon is installed via ember install ember-cli-htmlbars-inline-precompile.

Thanks

This addon wouldn't exist without the lightning fast response by open source hero @sebmck, who implemented the feature to replace a node with a source string not even an hour after I mentioned it in gitter ❤️.