Skip to content

Commit ba12496

Browse files
committed
Remove hasEmberVersion
1 parent d456685 commit ba12496

File tree

4 files changed

+1
-38
lines changed

4 files changed

+1
-38
lines changed

addon-test-support/adapter.js

-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Ember from 'ember';
22
import * as QUnit from 'qunit';
3-
import hasEmberVersion from '@ember/test-helpers/has-ember-version';
43

54
function unhandledRejectionAssertion(current, error) {
65
let message, source;
@@ -59,22 +58,6 @@ let Adapter = Ember.Test.Adapter.extend({
5958
done();
6059
}
6160
},
62-
63-
// clobber default implementation of `exception` will be added back for Ember
64-
// < 2.17 just below...
65-
exception: null,
6661
});
6762

68-
// Ember 2.17 and higher do not require the test adapter to have an `exception`
69-
// method When `exception` is not present, the unhandled rejection is
70-
// automatically re-thrown and will therefore hit QUnit's own global error
71-
// handler (therefore appropriately causing test failure)
72-
if (!hasEmberVersion(2, 17)) {
73-
Adapter = Adapter.extend({
74-
exception(error) {
75-
unhandledRejectionAssertion(QUnit.config.current, error);
76-
},
77-
});
78-
}
79-
8063
export default Adapter;

tests/acceptance/basic-test.js

-5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ import {
1010
click,
1111
} from '@ember/test-helpers';
1212
import { setResolverRegistry } from '../helpers/resolver';
13-
import hasEmberVersion from '@ember/test-helpers/has-ember-version';
1413

1514
module('setupApplicationTest tests', function (hooks) {
16-
if (!hasEmberVersion(2, 4)) {
17-
return;
18-
}
19-
2015
const Router = EmberRouter.extend({ location: 'none' });
2116
Router.map(function () {
2217
this.route('widgets');

tests/integration/setup-rendering-test-test.js

-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@ import { hbs } from 'ember-cli-htmlbars';
55
import { setupRenderingTest } from 'ember-qunit';
66
import { render } from '@ember/test-helpers';
77
import { setResolverRegistry } from '../helpers/resolver';
8-
import hasEmberVersion from '@ember/test-helpers/has-ember-version';
98

109
module('setupRenderingTest tests', function (hooks) {
11-
if (!hasEmberVersion(2, 4)) {
12-
return;
13-
}
14-
1510
hooks.beforeEach(function () {
1611
setResolverRegistry({});
1712
});

tests/integration/setup-test-test.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@ import { module, test } from 'qunit';
22
import Service, { inject as injectService } from '@ember/service';
33
import Component from '@ember/component';
44
import { setupTest } from 'ember-qunit';
5-
import hasEmberVersion from '@ember/test-helpers/has-ember-version';
65
import { setResolverRegistry } from '../helpers/resolver';
76

87
module('setupTest tests', function (hooks) {
9-
if (!hasEmberVersion(2, 4)) {
10-
return;
11-
}
12-
138
hooks.beforeEach(function () {
149
setResolverRegistry({});
1510
});
@@ -63,12 +58,7 @@ module('setupTest tests', function (hooks) {
6358
})
6459
);
6560

66-
let subject;
67-
if (hasEmberVersion(2, 12)) {
68-
subject = this.owner.lookup('component:foo-bar');
69-
} else {
70-
subject = this.owner._lookupFactory('component:foo-bar').create();
71-
}
61+
let subject = this.owner.lookup('component:foo-bar');
7262

7363
assert.equal(subject.someMethod(), 'hello thar!');
7464
});

0 commit comments

Comments
 (0)