Generate an Ember app with the Module Unification layout

    Today at EmberConf, Matthew Beale spoke about the new Module Unification directory layout that will be coming to Ember in the near future. If you want to try it out now, you can install the canary version of the Ember CLI and generate a new application. Thanks to npx, you can do this with a single command: MODULE_UNIFICATION=true npx ember-cli/ember-cli new __name_of_app__ This avoids needing to globally install the canary version of the Ember CLI but still gives you access to the bleeding-edge features.

    Read More

    Generate Integration test data with Mirage

    If you have an Ember component that requires an Ember Data model as an attribute, you might want to use Mirage to generate the models in the right shape. Thankfully, you can access Ember Data in your test to generate the data, then pass that into the component to test it. import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; import setupMirage from 'my-app/tests/helpers/setup-mirage'; import { find, render } from '@ember/test-helpers'; import { run } from '@ember/runloop'; module('Integration | Components | render-post', function(hooks) { setupRenderingTest(hooks); setupMirage(hooks); hooks.

    Read More

    Upgrading an Ember app to the new QUnit API

    I recently upgraded a large Ember app to the new API and ran into a few problems along the way. Here’s a few tips for making your transition smoother than mine was. Update your dependencies To start off, update to the latest ember-cli-qunit yarn ember install ember-cli-qunit Additionally, ember-test-helpers can be removed from your dependencies if you have it listed there, since ember-cli-qunit will bring in ember-qunit, which in turn will bring in the new version of that package, @ember/test-helpers.

    Read More