DEV: prevents asyncTestDiscourse/controllerFor/fixture to leak (#7717)

DEV: prevents asyncTestDiscourse/controllerFor/fixture to leak (#7717)

diff --git a/.eslintrc b/.eslintrc
index 0086b7f..a656e80 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -16,14 +16,11 @@
     "_": true,
     "andThen": true,
     "asyncRender": true,
-    "asyncTestDiscourse": true,
     "Blob": true,
     "bootbox": true,
     "click": true,
     "waitUntil": true,
     "getSettledState": true,
-    "collapseSelectKit": true,
-    "controllerFor": true,
     "count": true,
     "currentPath": true,
     "currentRouteName": true,
@@ -32,11 +29,9 @@
     "Discourse": true,
     "Ember": true,
     "exists": true,
-    "expandSelectKit": true,
     "File": true,
     "fillIn": true,
     "find": true,
-    "fixture": true,
     "Handlebars": true,
     "hasModule": true,
     "I18n": true,
diff --git a/test/javascripts/lib/click-track-edit-history-test.js.es6 b/test/javascripts/lib/click-track-edit-history-test.js.es6
index 10d05a9..e38c5d2 100644
--- a/test/javascripts/lib/click-track-edit-history-test.js.es6
+++ b/test/javascripts/lib/click-track-edit-history-test.js.es6
@@ -1,6 +1,6 @@
 import DiscourseURL from "discourse/lib/url";
 import ClickTrack from "discourse/lib/click-track";
-import { logIn } from "helpers/qunit-helpers";
+import { fixture, logIn } from "helpers/qunit-helpers";
 
 QUnit.module("lib:click-track-edit-history", {
   beforeEach() {
diff --git a/test/javascripts/lib/click-track-profile-page-test.js.es6 b/test/javascripts/lib/click-track-profile-page-test.js.es6
index 3496626..1d51d5f 100644
--- a/test/javascripts/lib/click-track-profile-page-test.js.es6
+++ b/test/javascripts/lib/click-track-profile-page-test.js.es6
@@ -1,6 +1,6 @@
 import DiscourseURL from "discourse/lib/url";
 import ClickTrack from "discourse/lib/click-track";
-import { logIn } from "helpers/qunit-helpers";
+import { fixture, logIn } from "helpers/qunit-helpers";
 
 QUnit.module("lib:click-track-profile-page", {
   beforeEach() {
diff --git a/test/javascripts/lib/click-track-test.js.es6 b/test/javascripts/lib/click-track-test.js.es6
index 17cf077..a80d25b 100644
--- a/test/javascripts/lib/click-track-test.js.es6
+++ b/test/javascripts/lib/click-track-test.js.es6
@@ -1,6 +1,6 @@
 import DiscourseURL from "discourse/lib/url";
 import ClickTrack from "discourse/lib/click-track";
-import { logIn } from "helpers/qunit-helpers";
+import { fixture, asyncTestDiscourse, logIn } from "helpers/qunit-helpers";
 
 QUnit.module("lib:click-track", {
   beforeEach() {
diff --git a/test/javascripts/lib/highlight-text-test.js.es6 b/test/javascripts/lib/highlight-text-test.js.es6
index 1c1ceae..d76b9e0 100644
--- a/test/javascripts/lib/highlight-text-test.js.es6
+++ b/test/javascripts/lib/highlight-text-test.js.es6
@@ -2,6 +2,7 @@ import {
   default as highlightText,
   CLASS_NAME
 } from "discourse/lib/highlight-text";
+import { fixture } from "helpers/qunit-helpers";
 
 QUnit.module("lib:highlight-text");
 
diff --git a/test/javascripts/lib/preload-store-test.js.es6 b/test/javascripts/lib/preload-store-test.js.es6
index b17d8f2..c43f2b8 100644
--- a/test/javascripts/lib/preload-store-test.js.es6
+++ b/test/javascripts/lib/preload-store-test.js.es6
@@ -1,4 +1,5 @@
 import PreloadStore from "preload-store";
+import { asyncTestDiscourse } from "helpers/qunit-helpers";
 
 QUnit.module("preload-store", {
   beforeEach() {
diff --git a/test/javascripts/lib/tooltip-test.js.es6 b/test/javascripts/lib/tooltip-test.js.es6
index df59cfd..5e69515 100644
--- a/test/javascripts/lib/tooltip-test.js.es6
+++ b/test/javascripts/lib/tooltip-test.js.es6
@@ -1,4 +1,5 @@
 import { registerTooltip, registerHoverTooltip } from "discourse/lib/tooltip";
+import { fixture } from "helpers/qunit-helpers";
 
 // prettier-ignore
 QUnit.module("lib:tooltip", {
diff --git a/test/javascripts/lib/upload-short-url-test.js.es6 b/test/javascripts/lib/upload-short-url-test.js.es6
index ae0434c..c18ae0f 100644
--- a/test/javascripts/lib/upload-short-url-test.js.es6
+++ b/test/javascripts/lib/upload-short-url-test.js.es6
@@ -4,6 +4,7 @@ import {
   resetCache
 } from "pretty-text/upload-short-url";
 import { ajax } from "discourse/lib/ajax";
+import { fixture } from "helpers/qunit-helpers";
 
 QUnit.module("lib:pretty-text/upload-short-url", {
   beforeEach() {
diff --git a/test/javascripts/test_helper.js b/test/javascripts/test_helper.js
index 35d9fbb..3fdeaae 100644
--- a/test/javascripts/test_helper.js
+++ b/test/javascripts/test_helper.js
@@ -176,11 +176,6 @@ QUnit.testDone(function() {
 // Load ES6 tests
 var helpers = require("helpers/qunit-helpers");
 
-// TODO: Replace with proper imports rather than globals
-window.asyncTestDiscourse = helpers.asyncTestDiscourse;
-window.controllerFor = helpers.controllerFor;
-window.fixture = helpers.fixture;
-
 function getUrlParameter(name) {
   name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
   var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");

GitHub sha: c573fa78

1 Like