Skip to content

Commit

Permalink
Merge pull request #15138 from sly7-7/fix-mocha-service-test-blueprint
Browse files Browse the repository at this point in the history
[BUGFIX Release]fix mocha blueprint service test filename
  • Loading branch information
rwjblue authored May 2, 2017
2 parents 69c9f1e + 91e1e17 commit 7e0af2e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions node-tests/blueprints/service-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,22 @@ describe('Acceptance: ember generate and destroy service', function() {
}));
});

it('service-test foo for mocha --pod', function() {
var args = ['service-test', 'foo', '--pod'];

return emberNew()
.then(() => modifyPackages([
{ name: 'ember-cli-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true }
]))
.then(() => generateFakePackageManifest('ember-cli-mocha', '0.11.0'))
.then(() => emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/foo/service-test.js'))
.to.contain("import { describeModule, it } from 'ember-mocha';")
.to.contain("describeModule('service:foo', 'Unit | Service | foo'");
}));
});

it('service-test foo for mocha v0.12+', function() {
var args = ['service-test', 'foo'];

Expand All @@ -200,4 +216,22 @@ describe('Acceptance: ember generate and destroy service', function() {
.to.contain("setupTest('service:foo',");
}));
});

it('service-test foo for mocha v0.12+ --pod', function() {
var args = ['service-test', 'foo', '--pod'];

return emberNew()
.then(() => modifyPackages([
{ name: 'ember-cli-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true }
]))
.then(() => generateFakePackageManifest('ember-cli-mocha', '0.12.0'))
.then(() => emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/foo/service-test.js'))
.to.contain("import { describe, it } from 'mocha';")
.to.contain("import { setupTest } from 'ember-mocha';")
.to.contain("describe('Unit | Service | foo', function() {")
.to.contain("setupTest('service:foo',");
}));
});
});

0 comments on commit 7e0af2e

Please sign in to comment.