Skip to content

Commit

Permalink
blueprints/mixin-test: Added RFC-232 variant
Browse files Browse the repository at this point in the history
  • Loading branch information
boyanyordanov committed Dec 8, 2017
1 parent e1dc61f commit cd86443
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import EmberObject from '@ember/object';
import <%= classifiedModuleName %>Mixin from '<%= projectName %>/mixins/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

module('<%= friendlyTestName %>', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it works', function (assert) {
let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
let subject = <%= classifiedModuleName %>Object.create();
assert.ok(subject);
});
});
14 changes: 14 additions & 0 deletions node-tests/blueprints/mixin-test-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const modifyPackages = blueprintHelpers.modifyPackages;
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;

const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');

describe('Blueprint: mixin-test', function() {
Expand Down Expand Up @@ -41,6 +42,19 @@ describe('Blueprint: mixin-test', function() {
});
});
});

describe('with ember-cli-qunit@4.1.1', function() {
beforeEach(function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.1');
});

it('mixin-test foo', function() {
return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
expect(_file('tests/unit/mixins/foo-test.js'))
.to.equal(fixture('mixin-test/rfc232.js'));
});
});
});
});

describe('in addon', function() {
Expand Down
15 changes: 15 additions & 0 deletions node-tests/fixtures/mixin-test/rfc232.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import EmberObject from '@ember/object';
import FooMixin from 'my-app/mixins/foo';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

module('Unit | Mixin | foo', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it works', function (assert) {
let FooObject = EmberObject.extend(FooMixin);
let subject = FooObject.create();
assert.ok(subject);
});
});

0 comments on commit cd86443

Please sign in to comment.