Moving QUnit extensions into test-helper
MODIFY
tests/acceptance/deferred-render-test.js
tests/acceptance/deferred-render-test.js
-import QUnit, { module, test } from 'qunit';
+import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { visit, find } from '@ember/test-helpers';
-QUnit.extend(QUnit.assert, {
- isVisible: function(el, message) {
- let result = el !== null && !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
- this.pushResult({ result, actual: result, expected: true, message });
- },
- isNotVisible: function(el, message) {
- let result = el === null || !(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
- this.pushResult({ result, actual: result, expected: true, message });
- }
-});
-
module('Acceptance | deferred render', function(hooks) {
setupApplicationTest(hooks);

MODIFY
tests/test-helper.js
tests/test-helper.js
@@ -2,6 +2,18 @@ import Application from '../app';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-cli-qunit';
+import QUnit from 'qunit';
+
+QUnit.extend(QUnit.assert, {
+ isVisible: function(el, message) {
+ let result = el !== null && !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
+ this.pushResult({ result, actual: result, expected: true, message });
+ },
+ isNotVisible: function(el, message) {
+ let result = el === null || !(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
+ this.pushResult({ result, actual: result, expected: true, message });
+ }
+});
setApplication(Application.create(config.APP));
start();

Moving QUnit extensions into test-helper