Skip to content

Commit

Permalink
Merge pull request #15950 from boyanyordanov/mixin-rfc232
Browse files Browse the repository at this point in the history
blueprints/mixin-test: Added RFC-232 variant
  • Loading branch information
rwjblue authored Dec 9, 2017
2 parents 6784b69 + 967ce0e commit 5b61b7e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import EmberObject from '@ember/object';
import <%= classifiedModuleName %>Mixin from '<%= projectName %>/mixins/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';

module('<%= friendlyTestName %>', function() {
// 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
12 changes: 12 additions & 0 deletions node-tests/fixtures/mixin-test/rfc232.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import EmberObject from '@ember/object';
import FooMixin from 'my-app/mixins/foo';
import { module, test } from 'qunit';

module('Unit | Mixin | foo', function() {
// 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 5b61b7e

Please sign in to comment.