From b15036b9a23526c52094ac8da706a9cc1d1b4652 Mon Sep 17 00:00:00 2001 From: Brian Runnells Date: Sat, 18 Aug 2018 07:23:39 -0500 Subject: [PATCH] add mocha rfc 232 route blueprint --- .../__root__/__testType__/__path__/__test__.js | 12 ++++++++++++ node-tests/blueprints/route-test-test.js | 18 ++++++++++++++++++ node-tests/fixtures/route-test/mocha-rfc232.js | 12 ++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js create mode 100644 node-tests/fixtures/route-test/mocha-rfc232.js diff --git a/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js new file mode 100644 index 00000000000..f2d0456e955 --- /dev/null +++ b/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js @@ -0,0 +1,12 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; +import { setupTest } from 'ember-mocha'; + +describe('<%= friendlyTestDescription %>', function() { + setupTest(); + + it('exists', function() { + let route = this.owner.lookup('route:<%= dasherizedModuleName %>'); + expect(route).to.be.ok; + }); +}); diff --git a/node-tests/blueprints/route-test-test.js b/node-tests/blueprints/route-test-test.js index 85fe41591dd..0bd4276d9dc 100644 --- a/node-tests/blueprints/route-test-test.js +++ b/node-tests/blueprints/route-test-test.js @@ -71,6 +71,24 @@ describe('Blueprint: route-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('route-test foo', function() { + return emberGenerateDestroy(['route-test', 'foo'], _file => { + expect(_file('tests/unit/routes/foo-test.js')).to.equal( + fixture('route-test/mocha-rfc232.js') + ); + }); + }); + }); }); describe('in addon', function() { diff --git a/node-tests/fixtures/route-test/mocha-rfc232.js b/node-tests/fixtures/route-test/mocha-rfc232.js new file mode 100644 index 00000000000..b368708f37e --- /dev/null +++ b/node-tests/fixtures/route-test/mocha-rfc232.js @@ -0,0 +1,12 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; +import { setupTest } from 'ember-mocha'; + +describe('Unit | Route | foo', function() { + setupTest(); + + it('exists', function() { + let route = this.owner.lookup('route:foo'); + expect(route).to.be.ok; + }); +});