From 6373f3ad1862cbb39041f823095d72c9c633a504 Mon Sep 17 00:00:00 2001 From: Brian Runnells Date: Wed, 3 Oct 2018 15:25:32 -0600 Subject: [PATCH] add transform mocha rfc 232 blueprints --- .../__root__/__path__/__test__.js | 13 ++++++ node-tests/blueprints/transform-test.js | 44 +++++++++++++++++++ .../fixtures/transform-test/mocha-rfc232.js | 13 ++++++ 3 files changed, 70 insertions(+) create mode 100644 blueprints/transform-test/mocha-rfc-232-files/__root__/__path__/__test__.js create mode 100644 node-tests/fixtures/transform-test/mocha-rfc232.js diff --git a/blueprints/transform-test/mocha-rfc-232-files/__root__/__path__/__test__.js b/blueprints/transform-test/mocha-rfc-232-files/__root__/__path__/__test__.js new file mode 100644 index 00000000000..a7fbabdb805 --- /dev/null +++ b/blueprints/transform-test/mocha-rfc-232-files/__root__/__path__/__test__.js @@ -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; + }); +}); diff --git a/node-tests/blueprints/transform-test.js b/node-tests/blueprints/transform-test.js index 31f879d5d40..f6ac63d27fe 100644 --- a/node-tests/blueprints/transform-test.js +++ b/node-tests/blueprints/transform-test.js @@ -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') + ); + }); + }); + }); }); }); @@ -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 } + ); + }); + }); }); }); }); diff --git a/node-tests/fixtures/transform-test/mocha-rfc232.js b/node-tests/fixtures/transform-test/mocha-rfc232.js new file mode 100644 index 00000000000..5ad1979debc --- /dev/null +++ b/node-tests/fixtures/transform-test/mocha-rfc232.js @@ -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; + }); +});