Skip to content

Commit

Permalink
Merge pull request #7546 from rwjblue/remove-extraneous-test-files
Browse files Browse the repository at this point in the history
Remove unused testing helper files.
  • Loading branch information
rwjblue committed Jan 12, 2018
2 parents f810b5d + b8739d2 commit 30b1826
Show file tree
Hide file tree
Showing 24 changed files with 84 additions and 221 deletions.
Empty file.
5 changes: 0 additions & 5 deletions blueprints/app/files/tests/helpers/destroy-app.js

This file was deleted.

21 changes: 0 additions & 21 deletions blueprints/app/files/tests/helpers/module-for-acceptance.js

This file was deleted.

17 changes: 0 additions & 17 deletions blueprints/app/files/tests/helpers/start-app.js

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions blueprints/module-unification-app/files/tests/helpers/start-app.js

This file was deleted.

1 change: 0 additions & 1 deletion tests/acceptance/addon-smoke-test-slow.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions tests/acceptance/smoke-test-slow.js
Original file line number Diff line number Diff line change
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 Expand Up @@ -152,7 +152,7 @@ describe('Acceptance: smoke-test', function() {
output = output.join(EOL);

expect(output).to.match(/fail\s+0/, 'no failures');
expect(output).to.match(/pass\s+11/, '11 passing');
expect(output).to.match(/pass\s+8/, '8 passing');
}));

it('ember new foo, build development, and verify generated files', co.wrap(function *() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import Ember from 'ember';
import { setupApplicationTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';

module('Acceptance', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});
module('Acceptance', function(hooks) {
setupApplicationTest(hooks);

test('renders properly', function(assert) {
visit('/');
test('renders properly', async function(assert) {
await visit('/');

andThen(function() {
var element = find('.basic-thing');
assert.equal(element.first().text().trim(), 'WOOT!!');
var element = this.element.querySelector('.basic-thing');
assert.equal(element.textContent.trim(), 'WOOT!!');
});
});

test('renders imported component', function(assert) {
visit('/');
test('renders imported component', async function(assert) {
await visit('/');

andThen(function() {
var element = find('.second-thing');
assert.equal(element.first().text().trim(), 'SECOND!!');
var element = this.element.querySelector('.second-thing');
assert.equal(element.textContent.trim(), 'SECOND!!');
});
});
33 changes: 12 additions & 21 deletions tests/fixtures/addon/kitchen-sink/tests/acceptance/main-test.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import { setupApplicationTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import truthyHelper from 'kitchen-sink/test-support/helper';
import { module, test } from 'qunit';

module('Acceptance', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});
module('Acceptance', function(hooks) {
setupApplicationTest(hooks);

test('renders properly', function(assert) {
visit('/');
test('renders properly', async function(assert) {
await visit('/');

andThen(function() {
var element = find('.basic-thing');
assert.equal(element.first().text().trim(), 'WOOT!!');
var element = this.element.querySelector('.basic-thing');
assert.equal(element.textContent.trim(), 'WOOT!!');
assert.ok(truthyHelper(), 'addon-test-support helper');
});
});

test('renders imported component', function(assert) {
visit('/');
test('renders imported component', async function(assert) {
await visit('/');

andThen(function() {
var element = find('.second-thing');
assert.equal(element.first().text().trim(), 'SECOND!!');
var element = this.element.querySelector('.second-thing');
assert.equal(element.textContent.trim(), 'SECOND!!');
});
});
Original file line number Diff line number Diff line change
@@ -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');
});
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import Ember from 'ember';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import { setupApplicationTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';

module('default-development - Integration', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});

test('the application boots properly', function(assert) {
assert.expect(1);
module('default-development - Integration', function(hook) {
setupApplicationTest(hooks);

visit('/');
test('renders properly', async function(assert) {
await visit('/');

andThen(function() {
assert.ok(Ember.$('.ember-view').length > 0);
var elements = this.element.querySelectorAll('.ember-view');
assert.ok(elements.length > 0);
});
});
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import Ember from 'ember';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import { setupApplicationTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';

module('pods based templates', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});
module('pods based templates', function(hooks) {
setupApplicationTest(hooks);

test('the application boots properly with pods based templates', function(assert) {
assert.expect(1);
test('the application boots properly with pods based templates', async function(assert) {
assert.expect(1);

visit('/');
await visit('/');

andThen(function() {
assert.equal(Ember.$('#title').text(), 'ZOMG, PODS WORKS!!');
let actual = this.element.querySelector('#title').textContent
assert.equal(actual, 'ZOMG, PODS WORKS!!');
});
});
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
import Ember from 'ember';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import { setupApplicationTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';

module('pods based templates', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});

module('pods based templates', function(hooks) {
setupApplicationTest(hooks);

test('the application boots properly with pods based templates with a podModulePrefix set', function(assert) {
assert.expect(1);
test('the application boots properly with pods based templates with a podModulePrefix set', async function(assert) {
assert.expect(1);

visit('/');
await visit('/');

andThen(function() {
assert.equal(Ember.$('#title').text(), 'ZOMG, PODS WORKS!!');
let actual = this.element.querySelector('#title').textContent
assert.equal(actual, 'ZOMG, PODS WORKS!!');
});
});
4 changes: 2 additions & 2 deletions tests/fixtures/brocfile-tests/query/app/app.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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');
});
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import moduleForAcceptance from '../helpers/module-for-acceptance';
import QUnit from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import QUnit, { module, test } from 'qunit';

let application, firstArgument;
let firstArgument;

moduleForAcceptance('Module', {
beforeEach(assert) {
application = this.application;
firstArgument = assert;
},
module('Module', function(hooks) {
setupApplicationTest(hooks);

afterEach() {
console.log('afterEach called');
}
});
hooks.beforeEach(function(assert) {
firstArgument = assert;
});

QUnit.test('it works', function(assert) {
assert.ok(application, 'beforeEach binds to the setup context');
assert.ok(
Object.getPrototypeOf(firstArgument) === QUnit.assert,
'first argument is QUnit assert'
);
test('it works', function(assert) {
assert.ok(this.owner, 'setupApplicationTest binds to the context');
assert.ok(
Object.getPrototypeOf(firstArgument) === QUnit.assert,
'first argument is QUnit assert'
);
});
});
Original file line number Diff line number Diff line change
@@ -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');
});
Loading

0 comments on commit 30b1826

Please sign in to comment.