Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rfc 232 mocha mixin blueprint #16914

Merged
merged 1 commit into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
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 = EmberObject.extend(<%= classifiedModuleName %>Mixin);
let subject = <%= classifiedModuleName %>Object.create();
expect(subject).to.be.ok;
});
});
18 changes: 18 additions & 0 deletions node-tests/blueprints/mixin-test-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ describe('Blueprint: mixin-test', function() {
});
});
});

describe('with [email protected]', function() {
beforeEach(function() {
modifyPackages([
{ name: 'ember-cli-qunit', delete: true },
{ name: 'ember-mocha', dev: true },
]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});

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

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

describe('Unit | Mixin | foo', function() {
// Replace this with your real tests.
it('works', function() {
let FooObject = EmberObject.extend(FooMixin);
let subject = FooObject.create();
expect(subject).to.be.ok;
});
});