Skip to content

Commit

Permalink
[CLEANUP] Moving off QUnit.config.current.assert
Browse files Browse the repository at this point in the history
Moving off of the QUnit global by refactoring away from
QUnit.config.current.assert.

Apart of emberjs#15988
  • Loading branch information
thoov committed Apr 3, 2018
1 parent 0ec7f45 commit 9af8bc4
Show file tree
Hide file tree
Showing 33 changed files with 67 additions and 61 deletions.
4 changes: 2 additions & 2 deletions packages/ember-application/tests/system/application_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ moduleFor(
'Application, default resolver with autoboot',
class extends DefaultResolverApplicationTestCase {
constructor() {
super();
super(...arguments);
this.originalLookup = context.lookup;
}

Expand Down Expand Up @@ -263,7 +263,7 @@ moduleFor(
'Application, autobooting',
class extends AutobootApplicationTestCase {
constructor() {
super();
super(...arguments);
this.originalLogVersion = ENV.LOG_VERSION;
this.originalDebug = getDebugFunction('debug');
this.originalWarn = getDebugFunction('warn');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ moduleFor(
class extends ApplicationTest {
constructor() {
setDebugFunction('debug', noop);
super();
super(...arguments);
}

teardown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ moduleFor(
'Application test: rendering',
class extends ApplicationTest {
constructor() {
super();
super(...arguments);
this._APPLICATION_TEMPLATE_WRAPPER = ENV._APPLICATION_TEMPLATE_WRAPPER;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { strip } from '../../utils/abstract-test-case';

class AbstractAppendTest extends RenderingTest {
constructor() {
super();
super(...arguments);

this.components = [];
this.ids = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ moduleFor(
'Components test: curly components',
class extends RenderingTest {
constructor() {
super();
super(...arguments);
this.originalDidInitAttrsSupport = ENV._ENABLE_DID_INIT_ATTRS_SUPPORT;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ moduleFor(
'Components compile instrumentation',
class extends RenderingTest {
constructor() {
super();
super(...arguments);

this.resetEvents();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ moduleFor(
'Components instrumentation',
class extends RenderingTest {
constructor() {
super();
super(...arguments);

this.resetEvents();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { runAppend } from 'internal-test-helpers';

class LifeCycleHooksTest extends RenderingTest {
constructor() {
super();
super(...arguments);
this.hooks = [];
this.components = {};
this.componentRegistry = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ moduleFor(
'Components test: sendAction',
class extends RenderingTest {
constructor() {
super();
super(...arguments);
this.actionCounts = {};
this.sendCount = 0;
this.actionArguments = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ moduleFor(
'Components test: template-only components (glimmer components)',
class extends TemplateOnlyComponentsTest {
constructor() {
super();
super(...arguments);
this._TEMPLATE_ONLY_GLIMMER_COMPONENTS = ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS;
ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS = true;
}
Expand Down Expand Up @@ -112,7 +112,7 @@ moduleFor(
'Components test: template-only components (curly components)',
class extends TemplateOnlyComponentsTest {
constructor() {
super();
super(...arguments);
this._TEMPLATE_ONLY_GLIMMER_COMPONENTS = ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS;
ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ moduleFor(
'View tree tests',
class extends ApplicationTest {
constructor() {
super();
super(...arguments);

this.addComponent('x-tagless', {
ComponentClass: Component.extend({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ moduleFor(
'EventDispatcher#setup',
class extends RenderingTest {
constructor() {
super();
super(...arguments);

let dispatcher = this.owner.lookup('event_dispatcher:main');
run(dispatcher, 'destroy');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { RenderingTest, moduleFor } from '../../utils/test-case';
import { runDestroy } from 'internal-test-helpers';
import { set } from 'ember-metal';

let assert = QUnit.assert;

moduleFor(
'Helpers test: custom helpers',
class extends RenderingTest {
Expand Down Expand Up @@ -88,7 +86,7 @@ moduleFor(
}, /You must call `this._super\(...arguments\);` when overriding `init` on a framework object. Please update .* to call `this._super\(...arguments\);` from `init`./);
}

['@test class-based helper can recompute a new value']() {
['@test class-based helper can recompute a new value'](assert) {
let destroyCount = 0;
let computeCount = 0;
let helper;
Expand Down Expand Up @@ -122,7 +120,7 @@ moduleFor(
assert.strictEqual(destroyCount, 0, 'destroy is not called on recomputation');
}

['@test class-based helper with static arguments can recompute a new value']() {
['@test class-based helper with static arguments can recompute a new value'](assert) {
let destroyCount = 0;
let computeCount = 0;
let helper;
Expand Down Expand Up @@ -180,7 +178,7 @@ moduleFor(
this.assertText('bob');
}

['@test simple helper is called for param changes']() {
['@test simple helper is called for param changes'](assert) {
let computeCount = 0;

this.registerHelper('hello-world', ([value]) => {
Expand Down Expand Up @@ -215,7 +213,7 @@ moduleFor(
assert.strictEqual(computeCount, 3, 'compute is called exactly 3 times');
}

['@test class-based helper compute is called for param changes']() {
['@test class-based helper compute is called for param changes'](assert) {
let createCount = 0;
let computeCount = 0;

Expand Down Expand Up @@ -417,7 +415,7 @@ moduleFor(
}, /Compile Error some-helper is not a modifier: Helpers may not be used in the element form/);
}

['@test class-based helper is torn down']() {
['@test class-based helper is torn down'](assert) {
let destroyCalled = 0;

this.registerHelper('some-helper', {
Expand Down Expand Up @@ -585,7 +583,9 @@ moduleFor(
assert.equal(instance.compute(), 'lolol', 'can invoke `.compute`');
}

['@test class-based helper can be invoked manually via `owner.factoryFor(...).create().compute()']() {
['@test class-based helper can be invoked manually via `owner.factoryFor(...).create().compute()'](
assert
) {
this.registerHelper('some-helper', {
compute() {
assert.ok(true, 'some-helper helper invoked');
Expand Down Expand Up @@ -646,7 +646,7 @@ if (!EmberDev.runningProdBuild) {
'Helpers test: mutation triggers errors - class based helper',
class extends HelperMutatingArgsTests {
constructor() {
super();
super(...arguments);

let compute = this.buildCompute();

Expand All @@ -661,7 +661,7 @@ if (!EmberDev.runningProdBuild) {
'Helpers test: mutation triggers errors - simple helper',
class extends HelperMutatingArgsTests {
constructor() {
super();
super(...arguments);

let compute = this.buildCompute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ moduleFor(
'Helpers test: {{loc}}',
class extends RenderingTest {
constructor() {
super();
super(...arguments);
setStrings({
'Hello Friend': 'Hallo Freund',
Hello: 'Hallo, %@',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ moduleFor(
'Helpers test: {{log}}',
class extends RenderingTest {
constructor() {
super();
super(...arguments);
/* eslint-disable no-console */
this.originalLog = console.log;
this.logCalls = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ moduleFor(
'Helpers test: {{render}}',
class extends RenderingTest {
constructor() {
super();
super(...arguments);
this.originalRenderSupport = ENV._ENABLE_RENDER_SUPPORT;
ENV._ENABLE_RENDER_SUPPORT = true;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/ember-glimmer/tests/integration/mount-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ moduleFor(
'{{mount}} test',
class extends ApplicationTest {
constructor() {
super();
super(...arguments);

let engineRegistrations = (this.engineRegistrations = {});

Expand Down Expand Up @@ -302,7 +302,7 @@ if (EMBER_ENGINES_MOUNT_PARAMS) {
'{{mount}} params tests',
class extends ApplicationTest {
constructor() {
super();
super(...arguments);

this.add(
'engine:paramEngine',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ moduleFor(
'Syntax test: {{#each-in}} with POJOs',
class extends EachInTest {
constructor() {
super();
super(...arguments);
this.allowsSetProp = true;
}

Expand Down Expand Up @@ -460,7 +460,7 @@ moduleFor(
'Syntax test: {{#each-in}} with EmberObjects',
class extends EachInTest {
constructor() {
super();
super(...arguments);
this.allowsSetProp = true;
}
createHash(pojo) {
Expand All @@ -485,7 +485,7 @@ moduleFor(
'Syntax test: {{#each-in}} with object proxies',
class extends EachInTest {
constructor() {
super();
super(...arguments);
this.allowsSetProp = true;
}
createHash(pojo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ if (typeof MutationObserver === 'function') {
'Syntax test: {{#each as}} DOM mutation test',
class extends RenderingTest {
constructor() {
super();
super(...arguments);
this.observer = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ moduleFor(
});
});

super();
super(...arguments);
this.originalMacros = originalMacros;
}

Expand Down
Loading

0 comments on commit 9af8bc4

Please sign in to comment.