diff --git a/blueprints/adapter-test/mocha-0.12-files/tests/unit/__path__/__test__.js b/blueprints/adapter-test/mocha-0.12-files/tests/unit/__path__/__test__.js deleted file mode 100644 index 1eb97b0b43a..00000000000 --- a/blueprints/adapter-test/mocha-0.12-files/tests/unit/__path__/__test__.js +++ /dev/null @@ -1,16 +0,0 @@ -import { expect } from 'chai'; -import { describe, it } from 'mocha'; -import { setupTest } from 'ember-mocha'; - -describe('<%= friendlyTestDescription %>', function() { - setupTest('adapter:<%= dasherizedModuleName %>', { - // Specify the other units that are required for this test. - // needs: ['serializer:foo'] - }); - - // Replace this with your real tests. - it('exists', function() { - let adapter = this.subject(); - expect(adapter).to.be.ok; - }); -}); diff --git a/blueprints/adapter-test/mocha-files/tests/unit/__path__/__test__.js b/blueprints/adapter-test/mocha-files/tests/unit/__path__/__test__.js index f26b5338dbf..1eb97b0b43a 100644 --- a/blueprints/adapter-test/mocha-files/tests/unit/__path__/__test__.js +++ b/blueprints/adapter-test/mocha-files/tests/unit/__path__/__test__.js @@ -1,18 +1,16 @@ import { expect } from 'chai'; -import { describeModule, it } from 'ember-mocha'; +import { describe, it } from 'mocha'; +import { setupTest } from 'ember-mocha'; -describeModule( - 'adapter:<%= dasherizedModuleName %>', - '<%= friendlyTestDescription %>', - { +describe('<%= friendlyTestDescription %>', function() { + setupTest('adapter:<%= dasherizedModuleName %>', { // Specify the other units that are required for this test. // needs: ['serializer:foo'] - }, - function() { - // Replace this with your real tests. - it('exists', function() { - let adapter = this.subject(); - expect(adapter).to.be.ok; - }); - } -); + }); + + // Replace this with your real tests. + it('exists', function() { + let adapter = this.subject(); + expect(adapter).to.be.ok; + }); +}); diff --git a/blueprints/model-test/mocha-0.12-files/tests/unit/__path__/__test__.js b/blueprints/model-test/mocha-0.12-files/tests/unit/__path__/__test__.js deleted file mode 100644 index 6850a578f78..00000000000 --- a/blueprints/model-test/mocha-0.12-files/tests/unit/__path__/__test__.js +++ /dev/null @@ -1,17 +0,0 @@ -import { expect } from 'chai'; -import { describe, it } from 'mocha'; -import { setupModelTest } from 'ember-mocha'; - -describe('<%= friendlyDescription %>', function() { - setupModelTest('<%= dasherizedModuleName %>', { - // Specify the other units that are required for this test. - <%= typeof needs !== 'undefined' ? needs : '' %> - }); - - // Replace this with your real tests. - it('exists', function() { - let model = this.subject(); - // var store = this.store(); - expect(model).to.be.ok; - }); -}); diff --git a/blueprints/model-test/mocha-files/tests/unit/__path__/__test__.js b/blueprints/model-test/mocha-files/tests/unit/__path__/__test__.js index b7bf32aa4cd..6850a578f78 100644 --- a/blueprints/model-test/mocha-files/tests/unit/__path__/__test__.js +++ b/blueprints/model-test/mocha-files/tests/unit/__path__/__test__.js @@ -1,19 +1,17 @@ import { expect } from 'chai'; -import { describeModel, it } from 'ember-mocha'; +import { describe, it } from 'mocha'; +import { setupModelTest } from 'ember-mocha'; -describeModel( - '<%= dasherizedModuleName %>', - '<%= friendlyDescription %>', - { +describe('<%= friendlyDescription %>', function() { + setupModelTest('<%= dasherizedModuleName %>', { // Specify the other units that are required for this test. <%= typeof needs !== 'undefined' ? needs : '' %> - }, - function() { - // Replace this with your real tests. - it('exists', function() { - let model = this.subject(); - // var store = this.store(); - expect(model).to.be.ok; - }); - } -); + }); + + // Replace this with your real tests. + it('exists', function() { + let model = this.subject(); + // var store = this.store(); + expect(model).to.be.ok; + }); +}); diff --git a/blueprints/serializer-test/mocha-0.12-files/tests/unit/__path__/__test__.js b/blueprints/serializer-test/mocha-0.12-files/tests/unit/__path__/__test__.js deleted file mode 100644 index fd852a5e0d9..00000000000 --- a/blueprints/serializer-test/mocha-0.12-files/tests/unit/__path__/__test__.js +++ /dev/null @@ -1,19 +0,0 @@ -import { expect } from 'chai'; -import { describe, it } from 'mocha'; -import { setupModelTest } from 'ember-mocha'; - -describe('<%= friendlyTestDescription %>', function() { - setupModelTest('<%= dasherizedModuleName %>', { - // Specify the other units that are required for this test. - needs: ['serializer:<%= dasherizedModuleName %>'] - }); - - // Replace this with your real tests. - it('serializes records', function() { - let record = this.subject(); - - let serializedRecord = record.serialize(); - - expect(serializedRecord).to.be.ok; - }); -}); diff --git a/blueprints/serializer-test/mocha-files/tests/unit/__path__/__test__.js b/blueprints/serializer-test/mocha-files/tests/unit/__path__/__test__.js index d8112c9884f..fd852a5e0d9 100644 --- a/blueprints/serializer-test/mocha-files/tests/unit/__path__/__test__.js +++ b/blueprints/serializer-test/mocha-files/tests/unit/__path__/__test__.js @@ -1,21 +1,19 @@ import { expect } from 'chai'; -import { describeModel, it } from 'ember-mocha'; +import { describe, it } from 'mocha'; +import { setupModelTest } from 'ember-mocha'; -describeModel( - '<%= dasherizedModuleName %>', - '<%= friendlyTestDescription %>', - { +describe('<%= friendlyTestDescription %>', function() { + setupModelTest('<%= dasherizedModuleName %>', { // Specify the other units that are required for this test. needs: ['serializer:<%= dasherizedModuleName %>'] - }, - function() { - // Replace this with your real tests. - it('serializes records', function() { - let record = this.subject(); + }); - let serializedRecord = record.serialize(); + // Replace this with your real tests. + it('serializes records', function() { + let record = this.subject(); - expect(serializedRecord).to.be.ok; - }); - } -); + let serializedRecord = record.serialize(); + + expect(serializedRecord).to.be.ok; + }); +}); diff --git a/blueprints/test-framework-detector.js b/blueprints/test-framework-detector.js index 2f8a2d988f8..d3b3e77c392 100644 --- a/blueprints/test-framework-detector.js +++ b/blueprints/test-framework-detector.js @@ -1,6 +1,5 @@ var fs = require('fs'); var path = require('path'); -var VersionChecker = require('ember-cli-version-checker'); module.exports = function(blueprint) { blueprint.supportsAddon = function() { @@ -14,12 +13,7 @@ module.exports = function(blueprint) { if ('ember-cli-qunit' in dependencies) { type = 'qunit'; } else if ('ember-cli-mocha' in dependencies) { - var checker = new VersionChecker({ project: this.project }); - if (fs.existsSync(this.path + '/mocha-0.12-files') && checker.for('ember-cli-mocha', 'npm').satisfies('>=0.12.0')) { - type = 'mocha-0.12'; - } else { - type = 'mocha'; - } + type = 'mocha'; } else { this.ui.writeLine('Couldn\'t determine test style - using QUnit'); type = 'qunit'; diff --git a/blueprints/transform-test/mocha-0.12-files/tests/unit/__path__/__test__.js b/blueprints/transform-test/mocha-0.12-files/tests/unit/__path__/__test__.js deleted file mode 100644 index fcbe57e5eed..00000000000 --- a/blueprints/transform-test/mocha-0.12-files/tests/unit/__path__/__test__.js +++ /dev/null @@ -1,16 +0,0 @@ -import { expect } from 'chai'; -import { describe, it } from 'mocha'; -import { setupTest } from 'ember-mocha'; - -describe('<%= friendlyTestDescription %>', function() { - setupTest('transform:<%= dasherizedModuleName %>', { - // Specify the other units that are required for this test. - // needs: ['transform:foo'] - }); - - // Replace this with your real tests. - it('exists', function() { - let transform = this.subject(); - expect(transform).to.be.ok; - }); -}); diff --git a/blueprints/transform-test/mocha-files/tests/unit/__path__/__test__.js b/blueprints/transform-test/mocha-files/tests/unit/__path__/__test__.js index c3d20680218..fcbe57e5eed 100644 --- a/blueprints/transform-test/mocha-files/tests/unit/__path__/__test__.js +++ b/blueprints/transform-test/mocha-files/tests/unit/__path__/__test__.js @@ -1,18 +1,16 @@ import { expect } from 'chai'; -import { describeModule, it } from 'ember-mocha'; +import { describe, it } from 'mocha'; +import { setupTest } from 'ember-mocha'; -describeModule( - 'transform:<%= dasherizedModuleName %>', - '<%= friendlyTestDescription %>', - { +describe('<%= friendlyTestDescription %>', function() { + setupTest('transform:<%= dasherizedModuleName %>', { // Specify the other units that are required for this test. // needs: ['transform:foo'] - }, - function() { - // Replace this with your real tests. - it('exists', function() { - let transform = this.subject(); - expect(transform).to.be.ok; - }); - } -); + }); + + // Replace this with your real tests. + it('exists', function() { + let transform = this.subject(); + expect(transform).to.be.ok; + }); +}); diff --git a/node-tests/blueprints/adapter-test.js b/node-tests/blueprints/adapter-test.js index 6acb989b33d..38a4d5cc000 100644 --- a/node-tests/blueprints/adapter-test.js +++ b/node-tests/blueprints/adapter-test.js @@ -90,23 +90,6 @@ describe('Acceptance: generate and destroy adapter blueprints', function() { })); }); - it('adapter-test for mocha', function() { - var args = ['adapter-test', 'foo']; - - 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/adapters/foo-test.js')) - .to.contain('import { describeModule, it } from \'ember-mocha\';') - .to.contain('describeModule(\n \'adapter:foo\',') - .to.contain('expect(adapter).to.be.ok;'); - })); - }); - it('adapter-test for mocha v0.12+', function() { var args = ['adapter-test', 'foo']; diff --git a/node-tests/blueprints/model-test.js b/node-tests/blueprints/model-test.js index 6b57bf5a1fb..d0d1eaa8078 100644 --- a/node-tests/blueprints/model-test.js +++ b/node-tests/blueprints/model-test.js @@ -103,23 +103,6 @@ describe('Acceptance: generate and destroy model blueprints', function() { })); }); - it('model-test for mocha', function() { - var args = ['model-test', 'foo']; - - 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/models/foo-test.js')) - .to.contain('import { describeModel, it } from \'ember-mocha\';') - .to.contain('describeModel(\n \'foo\',') - .to.contain('expect(model).to.be.ok;'); - })); - }); - it('model-test for mocha v0.12+', function() { var args = ['model-test', 'foo']; diff --git a/node-tests/blueprints/serializer-test.js b/node-tests/blueprints/serializer-test.js index 9cee0241e7e..5a8b1dff8e4 100644 --- a/node-tests/blueprints/serializer-test.js +++ b/node-tests/blueprints/serializer-test.js @@ -90,26 +90,7 @@ describe('Acceptance: generate and destroy serializer blueprints', function() { })); }); - it('serializer-test for mocha', function() { - var args = ['serializer-test', 'foo']; - - 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/serializers/foo-test.js')) - .to.contain('import { describeModel, it } from \'ember-mocha\';') - .to.contain('describeModel(\n \'foo\',') - .to.contain('Unit | Serializer | foo') - .to.contain('needs: [\'serializer:foo\']') - .to.contain('expect(serializedRecord).to.be.ok;'); - })); - }); - - it('serializer-test for mocha v0.12+', function() { + it('serializer-test for mocha v0.12+', function() { var args = ['serializer-test', 'foo']; return emberNew() diff --git a/node-tests/blueprints/transform-test.js b/node-tests/blueprints/transform-test.js index 8d934d7218e..bd9a96be7aa 100644 --- a/node-tests/blueprints/transform-test.js +++ b/node-tests/blueprints/transform-test.js @@ -38,23 +38,6 @@ describe('Acceptance: generate and destroy transform blueprints', function() { })); }); - it('transform-test for mocha', function() { - var args = ['transform-test', 'foo']; - - 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/transforms/foo-test.js')) - .to.contain('import { describeModule, it } from \'ember-mocha\';') - .to.contain('describeModule(\n \'transform:foo\',') - .to.contain('expect(transform).to.be.ok;'); - })); - }); - it('transform-test for mocha v0.12+', function() { var args = ['transform-test', 'foo']; diff --git a/package.json b/package.json index d726784a2e6..af560db8dd5 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "ember-cli-path-utils": "^1.0.0", "ember-cli-string-utils": "^1.0.0", "ember-cli-test-info": "^1.0.0", - "ember-cli-version-checker": "^1.1.4", + "ember-cli-version-checker": "^2.1.0", "ember-inflector": "^2.0.0", "ember-runtime-enumerable-includes-polyfill": "^2.0.0", "exists-sync": "0.0.3", diff --git a/yarn.lock b/yarn.lock index f7728b4c498..c38e1aeccfa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2466,7 +2466,7 @@ ember-cli-version-checker@^1.0.2, ember-cli-version-checker@^1.1.4, ember-cli-ve dependencies: semver "^5.3.0" -ember-cli-version-checker@^2.0.0: +ember-cli-version-checker@^2.0.0, ember-cli-version-checker@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-2.1.0.tgz#fc79a56032f3717cf844ada7cbdec1a06fedb604" dependencies: