Skip to content

Commit

Permalink
Merge pull request #16913 from Dhaulagiri/br-232-mocha-service
Browse files Browse the repository at this point in the history
add mocha rfc 232 service test blueprint
  • Loading branch information
rwjblue authored Sep 4, 2018
2 parents be8a162 + 4f51ebd commit 9576673
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,13 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';

describe('<%= friendlyTestDescription %>', function() {
setupTest();

// Replace this with your real tests.
it('exists', function() {
let service = this.owner.lookup('service:<%= dasherizedModuleName %>');
expect(service).to.be.ok;
});
});
18 changes: 18 additions & 0 deletions node-tests/blueprints/service-test-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,24 @@ describe('Blueprint: service-test', function() {
});
});

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

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

describe('with ember-cli-qunit@4.2.0', function() {
beforeEach(function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
Expand Down
13 changes: 13 additions & 0 deletions node-tests/fixtures/service-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 { setupTest } from 'ember-mocha';

describe('Unit | Service | foo', function() {
setupTest();

// Replace this with your real tests.
it('exists', function() {
let service = this.owner.lookup('service:foo');
expect(service).to.be.ok;
});
});

0 comments on commit 9576673

Please sign in to comment.