Skip to content

Commit

Permalink
Updates blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
locks committed Jul 30, 2017
1 parent 647da02 commit ee87d12
Show file tree
Hide file tree
Showing 25 changed files with 221 additions and 216 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, beforeEach, afterEach } from 'mocha';
import { expect } from 'chai';
import startApp from '<%= dasherizedPackageName %>/tests/helpers/start-app';
<% if (destroyAppExists) { %>import destroyApp from '<%= dasherizedPackageName %>/tests/helpers/destroy-app';<% } else { %>import Ember from 'ember';<% } %>
<% if (destroyAppExists) { %>import destroyApp from '<%= dasherizedPackageName %>/tests/helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>

describe('<%= friendlyTestName %>', function() {
let application;
Expand All @@ -11,7 +11,7 @@ describe('<%= friendlyTestName %>', function() {
});

afterEach(function() {
<% if (destroyAppExists) { %>destroyApp(application);<% } else { %>Ember.run(application, 'destroy');<% } %>
<% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
});

it('can visit /<%= dasherizedModuleName %>', function() {
Expand Down
4 changes: 2 additions & 2 deletions blueprints/component/files/__root__/__path__/__name__.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ember from 'ember';
import Component from '@ember/component';
<%= importTemplate %>
export default Ember.Component.extend({<%= contents %>
export default Component.extend({<%= contents %>
});
4 changes: 2 additions & 2 deletions blueprints/controller/files/__root__/__path__/__name__.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ember from 'ember';
import Controller from '@ember/controller';

export default Ember.Controller.extend({
export default Controller.extend({
});
4 changes: 2 additions & 2 deletions blueprints/helper/files/__root__/helpers/__name__.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import { helper } from '@ember/component/helper';

export function <%= camelizedModuleName %>(params/*, hash*/) {
return params;
}

export default Ember.Helper.helper(<%= camelizedModuleName %>);
export default helper(<%= camelizedModuleName %>);
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { expect } from 'chai';
import { describe, it, beforeEach, afterEach } from 'mocha';
import Ember from 'ember';
import { run } from '@ember/runloop';
import Application from '@ember/application';
import { initialize } from '<%= dasherizedModulePrefix %>/initializers/<%= dasherizedModuleName %>';
import destroyApp from '../../helpers/destroy-app';

describe('<%= friendlyTestName %>', function() {
let application;

beforeEach(function() {
Ember.run(function() {
application = Ember.Application.create();
run(function() {
application = Application.create();
application.deferReadiness();
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Ember from 'ember';
import Application from '@ember/application';
import { run } from '@ember/runloop';

import { initialize } from '<%= dasherizedModulePrefix %>/initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
import destroyApp from '../../helpers/destroy-app';

module('<%= friendlyTestName %>', {
beforeEach() {
Ember.run(() => {
this.application = Ember.Application.create();
run(() => {
this.application = Application.create();
this.application.deferReadiness();
});
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import Ember from 'ember';
import Application from '@ember/application';
import { run } from '@ember/runloop';
import { initialize } from '<%= dasherizedModulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
import destroyApp from '../../helpers/destroy-app';

describe('<%= friendlyTestName %>', function() {
let application, appInstance;

beforeEach(function() {
Ember.run(function() {
application = Ember.Application.create();
run(function() {
application = Application.create();
appInstance = application.buildInstance();
});
});

afterEach(function() {
Ember.run(appInstance, 'destroy');
run(appInstance, 'destroy');
destroyApp(application);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import Ember from 'ember';
import Application from '@ember/application';
import { run } from '@ember/runloop';
import { initialize } from '<%= dasherizedModulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
import destroyApp from '../../helpers/destroy-app';

module('<%= friendlyTestName %>', {
beforeEach() {
Ember.run(() => {
this.application = Ember.Application.create();
run(() => {
this.application = Application.create();
this.appInstance = this.application.buildInstance();
});
},
afterEach() {
Ember.run(this.appInstance, 'destroy');
run(this.appInstance, 'destroy');
destroyApp(this.application);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import Ember from 'ember';
import EmberObject from '@ember/object';
import <%= classifiedModuleName %>Mixin from '<%= dasherizedPackageName %>/mixins/<%= dasherizedModuleName %>';

describe('<%= friendlyTestName %>', function() {
// Replace this with your real tests.
it('works', function() {
let <%= classifiedModuleName %>Object = Ember.Object.extend(<%= classifiedModuleName %>Mixin);
let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
let subject = <%= classifiedModuleName %>Object.create();
expect(subject).to.be.ok;
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Ember from 'ember';
import EmberObject from '@ember/object';
import <%= classifiedModuleName %>Mixin from '<%= projectName %>/mixins/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';

module('<%= friendlyTestName %>');

// Replace this with your real tests.
test('it works', function(assert) {
let <%= classifiedModuleName %>Object = Ember.Object.extend(<%= classifiedModuleName %>Mixin);
let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
let subject = <%= classifiedModuleName %>Object.create();
assert.ok(subject);
});
4 changes: 2 additions & 2 deletions blueprints/mixin/files/__root__/mixins/__name__.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ember from 'ember';
import Mixin from '@ember/object/mixin';

export default Ember.Mixin.create({
export default Mixin.create({
});
4 changes: 2 additions & 2 deletions blueprints/route/files/__root__/__path__/__name__.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ember from 'ember';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
});
4 changes: 2 additions & 2 deletions blueprints/service/files/__root__/__path__/__name__.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ember from 'ember';
import Service from '@ember/service';

export default Ember.Service.extend({
export default Service.extend({
});
4 changes: 2 additions & 2 deletions blueprints/test-helper/files/tests/helpers/__name__.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';
import { registerAsyncHelper } from '@ember/test';

export default Ember.Test.registerAsyncHelper('<%= camelizedModuleName %>', function(app) {
export default registerAsyncHelper('<%= camelizedModuleName %>', function(app) {

});
Loading

0 comments on commit ee87d12

Please sign in to comment.