Skip to content

Commit

Permalink
Remove createESLintConfig option from tests/helpers/acceptance.
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
rwjblue authored and timothypark-sq committed Jan 19, 2018
1 parent f7eaab5 commit 33af4d0
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 28 deletions.
1 change: 0 additions & 1 deletion tests/acceptance/addon-smoke-test-slow.js
Expand Up @@ -29,7 +29,6 @@ describe('Acceptance: addon-smoke-test', function() {
before(function() {
return createTestTargets(addonName, {
command: 'addon',
createESLintConfig: true,
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/brocfile-smoke-test-slow.js
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/smoke-test-slow.js
Expand Up @@ -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);
Expand Down
@@ -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');
});
@@ -1,4 +1,3 @@
import Ember from 'ember';
import { setupApplicationTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';
Expand Down
@@ -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
Expand Down
@@ -1,4 +1,3 @@
import Ember from 'ember';
import { setupApplicationTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';
Expand Down
4 changes: 2 additions & 2 deletions 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
Expand Down
@@ -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');
});
@@ -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');
});
@@ -1,3 +1,5 @@
QUnit.test('syntax error', function(assert) {
import { test } from 'qunit';

test('syntax error', function(assert) {
# syntax error
});
15 changes: 0 additions & 15 deletions tests/helpers/acceptance.js
Expand Up @@ -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 = {};

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 33af4d0

Please sign in to comment.