Skip to content

Commit

Permalink
fix blueprints to account for ember-qunit update
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Apr 5, 2018
1 parent cd4009d commit 83aa675
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 99 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

moduleFor('adapter:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', {
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});
module('<%= friendlyTestDescription %>', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it exists', function(assert) {
let adapter = this.subject();
assert.ok(adapter);
// Replace this with your real tests.
test('it exists', function(assert) {
let adapter = this.owner.lookup('adapter:<%= dasherizedModuleName %>');
assert.ok(adapter);
});
});

This file was deleted.

20 changes: 11 additions & 9 deletions blueprints/model-test/qunit-files/tests/unit/__path__/__test__.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { moduleForModel, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { run } from '@ember/runloop';

moduleForModel('<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', {
// Specify the other units that are required for this test.
<%= typeof needs !== 'undefined' ? needs : '' %>
});
module('<%= friendlyTestDescription %>', function(hooks) {
setupTest(hooks);

test('it exists', function(assert) {
let model = this.subject();
// let store = this.store();
assert.ok(!!model);
// Replace this with your real tests.
test('it exists', function(assert) {
let store = this.owner.lookup('service:store');
let model = run(() => store.createRecord('<%= dasherizedModuleName %>', {}));
assert.ok(model);
});
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import { moduleForModel, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { run } from '@ember/runloop';

moduleForModel('<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', {
// Specify the other units that are required for this test.
needs: ['serializer:<%= dasherizedModuleName %>']
});
module('<%= friendlyTestDescription %>', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it exists', function(assert) {
let store = this.owner.lookup('service:store');
let serializer = store.serializerFor('<%= dasherizedModuleName %>');

assert.ok(serializer);
});

// Replace this with your real tests.
test('it serializes records', function(assert) {
let record = this.subject();
test('it serializes records', function(assert) {
let store = this.owner.lookup('service:store');
let record = run(() => store.createRecord('<%= dasherizedModuleName %>', {}));

let serializedRecord = record.serialize();
let serializedRecord = record.serialize();

assert.ok(serializedRecord);
assert.ok(serializedRecord);
});
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

moduleFor('transform:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', {
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});
module('transform:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it exists', function(assert) {
let transform = this.subject();
assert.ok(transform);
// Replace this with your real tests.
test('it exists', function(assert) {
let transform = this.owner.lookup('transform:<%= dasherizedModuleName %>');
assert.ok(transform);
});
});

This file was deleted.

0 comments on commit 83aa675

Please sign in to comment.