Skip to content

Commit

Permalink
use new test syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden committed May 5, 2018
1 parent 11e0bc6 commit bae0225
Show file tree
Hide file tree
Showing 24 changed files with 1,461 additions and 1,500 deletions.
9 changes: 0 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ module.exports = {
})
},

// test files
{
files: ['tests/**/*.js'],
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true
}
},

{
files: ['node-tests/**/*.js'],
env: {
Expand Down
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"ember-disable-prototype-extensions": "^1.1.2",
"ember-load-initializers": "^1.0.0",
"ember-macro-test-helpers": "^3.1.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-resolver": "^4.0.0",
"ember-sinon": "^2.1.0",
"ember-source": "~3.1.0",
Expand Down
47 changes: 19 additions & 28 deletions tests/acceptance/application-test.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
import { test } from 'qunit';
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
import { click, find, visit } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';

moduleForAcceptance('Acceptance | application');
module('Acceptance | application', function(hooks) {
setupApplicationTest(hooks);

test('double render failing test', function(assert) {
visit('/double-render');
test('double render failing test', async function(assert) {
await visit('/double-render');

andThen(function() {
assert.equal(find('.computed').text(), 'test val 1');
});
assert.equal(find('.computed').textContent, 'test val 1');

click('button');
await click('button');

andThen(function() {
assert.equal(find('.computed').text(), 'test val 2');
});
assert.equal(find('.computed').textContent, 'test val 2');

click('button');
await click('button');

andThen(function() {
assert.equal(find('.computed').text(), 'test val 3');
assert.equal(find('.computed').textContent, 'test val 3');
});
});

test('no rerender failing test', function(assert) {
visit('/no-rerender');
test('no rerender failing test', async function(assert) {
await visit('/no-rerender');

andThen(function() {
assert.equal(find('.items').text(), 1);
});
assert.equal(find('.items').textContent, 1);

click('button');
await click('button');

andThen(function() {
assert.equal(find('.items').text(), 0);
});
assert.equal(find('.items').textContent, 0);

click('button');
await click('button');

andThen(function() {
assert.equal(find('.items').text(), 1);
assert.equal(find('.items').textContent, 1);
});
});
Empty file removed tests/helpers/.gitkeep
Empty file.
5 changes: 0 additions & 5 deletions tests/helpers/destroy-app.js

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Loading

0 comments on commit bae0225

Please sign in to comment.