Skip to content

Commit

Permalink
add transform mocha rfc 232 blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhaulagiri committed Oct 3, 2018
1 parent 7cd89cf commit 6373f3a
Show file tree
Hide file tree
Showing 3 changed files with 70 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 transform = this.owner.lookup('transform:<%= dasherizedModuleName %>');
expect(transform).to.be.ok;
});
});
44 changes: 44 additions & 0 deletions node-tests/blueprints/transform-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ describe('Acceptance: generate and destroy transform blueprints', function() {
});
});
});

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

it('transform-test for mocha v0.14+', function() {
let args = ['transform-test', 'foo'];

return emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/transforms/foo-test.js')).to.equal(
fixture('transform-test/mocha-rfc232.js')
);
});
});
});
});
});

Expand Down Expand Up @@ -164,6 +184,30 @@ describe('Acceptance: generate and destroy transform blueprints', function() {
);
});
});

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

it('transform-test for mocha v0.14+', function() {
let args = ['transform-test', 'foo'];

return emberGenerateDestroy(
args,
_file => {
expect(_file('src/data/transforms/foo-test.js')).to.equal(
fixture('transform-test/mocha-rfc232.js')
);
},
{ isModuleUnification: true }
);
});
});
});
});
});
13 changes: 13 additions & 0 deletions node-tests/fixtures/transform-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 | Transform | foo', function() {
setupTest();

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

0 comments on commit 6373f3a

Please sign in to comment.