From b8739d27fbe7f56f4ed5a981737927c5b2a82df2 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 11 Jan 2018 18:53:36 -0500 Subject: [PATCH] Remove `createESLintConfig` option from tests/helpers/acceptance. This option was added at a time where the default ember-cli blueprint did not include any eslint config (it was housed in ember-cli-eslint itself and only added during `ember new` by running the `ember-cli-eslint` blueprint). At that time a basic ESLint config was needed to prevent tests from completely blowing up, so this option was added... Fast-forward to the present: the default eslint configuration is now managed by ember-cli itself, and this override option is not providing value (in fact it is adding pain because it does not confirm the default blueprint passes linting). This commit removes the now unneeded feature... --- tests/acceptance/addon-smoke-test-slow.js | 1 - tests/acceptance/brocfile-smoke-test-slow.js | 2 +- tests/acceptance/smoke-test-slow.js | 2 +- .../tests/unit/config-test.js | 3 ++- .../tests/integration/pods-template-test.js | 1 - .../pods-with-prefix-templates/app/app.js | 4 ++-- .../tests/integration/pods-template-test.js | 1 - tests/fixtures/brocfile-tests/query/app/app.js | 4 ++-- .../failing-test/tests/unit/some-test.js | 4 +++- .../passing-test/tests/unit/some-test.js | 4 +++- .../tests/unit/some-test.js | 4 +++- tests/helpers/acceptance.js | 15 --------------- 12 files changed, 17 insertions(+), 28 deletions(-) diff --git a/tests/acceptance/addon-smoke-test-slow.js b/tests/acceptance/addon-smoke-test-slow.js index 04719d5168..d907318ffe 100644 --- a/tests/acceptance/addon-smoke-test-slow.js +++ b/tests/acceptance/addon-smoke-test-slow.js @@ -29,7 +29,6 @@ describe('Acceptance: addon-smoke-test', function() { before(function() { return createTestTargets(addonName, { command: 'addon', - createESLintConfig: true, }); }); diff --git a/tests/acceptance/brocfile-smoke-test-slow.js b/tests/acceptance/brocfile-smoke-test-slow.js index 4191ff0c0d..621c3743ad 100644 --- a/tests/acceptance/brocfile-smoke-test-slow.js +++ b/tests/acceptance/brocfile-smoke-test-slow.js @@ -26,7 +26,7 @@ describe('Acceptance: brocfile-smoke-test', function() { this.timeout(500000); before(function() { - return createTestTargets(appName, { createESLintConfig: true }); + return createTestTargets(appName); }); after(teardownTestTargets); diff --git a/tests/acceptance/smoke-test-slow.js b/tests/acceptance/smoke-test-slow.js index 505dda2b47..207bbf588e 100644 --- a/tests/acceptance/smoke-test-slow.js +++ b/tests/acceptance/smoke-test-slow.js @@ -28,7 +28,7 @@ let appRoot; describe('Acceptance: smoke-test', function() { this.timeout(500000); before(function() { - return createTestTargets(appName, { createESLintConfig: true }); + return createTestTargets(appName); }); after(teardownTestTargets); diff --git a/tests/fixtures/brocfile-tests/custom-environment-config/tests/unit/config-test.js b/tests/fixtures/brocfile-tests/custom-environment-config/tests/unit/config-test.js index 57353d7139..0782895554 100644 --- a/tests/fixtures/brocfile-tests/custom-environment-config/tests/unit/config-test.js +++ b/tests/fixtures/brocfile-tests/custom-environment-config/tests/unit/config-test.js @@ -1,5 +1,6 @@ +import { test } from 'qunit'; import config from '../../config/environment'; -QUnit.test('the correct config is used', function(assert) { +test('the correct config is used', function(assert) { assert.equal(config.fileUsed, 'config/something-else.js'); }); diff --git a/tests/fixtures/brocfile-tests/pods-templates/tests/integration/pods-template-test.js b/tests/fixtures/brocfile-tests/pods-templates/tests/integration/pods-template-test.js index d2e335881c..5169799ac1 100644 --- a/tests/fixtures/brocfile-tests/pods-templates/tests/integration/pods-template-test.js +++ b/tests/fixtures/brocfile-tests/pods-templates/tests/integration/pods-template-test.js @@ -1,4 +1,3 @@ -import Ember from 'ember'; import { setupApplicationTest } from 'ember-qunit'; import { visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; diff --git a/tests/fixtures/brocfile-tests/pods-with-prefix-templates/app/app.js b/tests/fixtures/brocfile-tests/pods-with-prefix-templates/app/app.js index 00e4c7a754..886c8976c2 100644 --- a/tests/fixtures/brocfile-tests/pods-with-prefix-templates/app/app.js +++ b/tests/fixtures/brocfile-tests/pods-with-prefix-templates/app/app.js @@ -1,8 +1,8 @@ -import Ember from 'ember'; +import Application from '@ember/application'; import Resolver from 'ember-resolver'; import loadInitializers from 'ember-load-initializers'; -const App = Ember.Application.extend({ +const App = Application.extend({ modulePrefix: 'some-cool-app', podModulePrefix: 'some-cool-app/pods', Resolver: Resolver diff --git a/tests/fixtures/brocfile-tests/pods-with-prefix-templates/tests/integration/pods-template-test.js b/tests/fixtures/brocfile-tests/pods-with-prefix-templates/tests/integration/pods-template-test.js index 0d6c81e254..50a4e4adb6 100644 --- a/tests/fixtures/brocfile-tests/pods-with-prefix-templates/tests/integration/pods-template-test.js +++ b/tests/fixtures/brocfile-tests/pods-with-prefix-templates/tests/integration/pods-template-test.js @@ -1,4 +1,3 @@ -import Ember from 'ember'; import { setupApplicationTest } from 'ember-qunit'; import { visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; diff --git a/tests/fixtures/brocfile-tests/query/app/app.js b/tests/fixtures/brocfile-tests/query/app/app.js index dbe7de4b96..0bf285d84d 100644 --- a/tests/fixtures/brocfile-tests/query/app/app.js +++ b/tests/fixtures/brocfile-tests/query/app/app.js @@ -1,8 +1,8 @@ -import Ember from 'ember'; +import Application from '@ember/application'; import Resolver from 'ember-resolver'; import loadInitializers from 'ember-load-initializers'; -const App = Ember.Application.extend({ +const App = Application.extend({ modulePrefix: 'query', podModulePrefix: 'app/pods', Resolver: Resolver diff --git a/tests/fixtures/smoke-tests/failing-test/tests/unit/some-test.js b/tests/fixtures/smoke-tests/failing-test/tests/unit/some-test.js index b98a02147c..1782be5464 100644 --- a/tests/fixtures/smoke-tests/failing-test/tests/unit/some-test.js +++ b/tests/fixtures/smoke-tests/failing-test/tests/unit/some-test.js @@ -1,3 +1,5 @@ -QUnit.test('failing test', function(assert) { +import { test } from 'qunit'; + +test('failing test', function(assert) { assert.ok(false, 'test should fail to confirm ember test exit code'); }); diff --git a/tests/fixtures/smoke-tests/passing-test/tests/unit/some-test.js b/tests/fixtures/smoke-tests/passing-test/tests/unit/some-test.js index 237daf43b8..4d12dc60e7 100644 --- a/tests/fixtures/smoke-tests/passing-test/tests/unit/some-test.js +++ b/tests/fixtures/smoke-tests/passing-test/tests/unit/some-test.js @@ -1,3 +1,5 @@ -QUnit.test('passing test', function(assert) { +import { test } from 'qunit'; + +test('passing test', function(assert) { assert.ok(true, 'test should pass'); }); diff --git a/tests/fixtures/smoke-tests/test-with-syntax-error/tests/unit/some-test.js b/tests/fixtures/smoke-tests/test-with-syntax-error/tests/unit/some-test.js index 8a3ffad0a6..d09d61f5b2 100644 --- a/tests/fixtures/smoke-tests/test-with-syntax-error/tests/unit/some-test.js +++ b/tests/fixtures/smoke-tests/test-with-syntax-error/tests/unit/some-test.js @@ -1,3 +1,5 @@ -QUnit.test('syntax error', function(assert) { +import { test } from 'qunit'; + +test('syntax error', function(assert) { # syntax error }); diff --git a/tests/helpers/acceptance.js b/tests/helpers/acceptance.js index 7758bc2568..3236a670c3 100644 --- a/tests/helpers/acceptance.js +++ b/tests/helpers/acceptance.js @@ -3,15 +3,12 @@ const symlinkOrCopySync = require('symlink-or-copy').sync; const path = require('path'); const fs = require('fs-extra'); -const RSVP = require('rsvp'); const runCommand = require('./run-command'); let root = path.resolve(__dirname, '..', '..'); const PackageCache = require('../../tests/helpers/package-cache'); -const outputFile = RSVP.denodeify(fs.outputFile); - const quickTemp = require('quick-temp'); let dirs = {}; @@ -57,18 +54,6 @@ function createTestTargets(projectName, options) { options.command = options.command || 'new'; return applyCommand(options.command, projectName, '--skip-npm', '--skip-bower', `--directory=${outputDir}`) - .then(() => { - if (options.createESLintConfig) { - let eslintConfig = `module.exports = { - root: true, - parserOptions: { - sourceType: 'module' - }, - };`; - - return outputFile(`${outputDir}/.eslintrc.js`, eslintConfig); - } - }) .catch(handleResult); }