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

This commit is contained in:
Joffrey JAFFEUX
2019-06-06 13:10:41 +02:00
committed by GitHub
parent 60c073ae59
commit c573fa780b
9 changed files with 7 additions and 13 deletions

View File

@ -16,14 +16,11 @@
"_": true, "_": true,
"andThen": true, "andThen": true,
"asyncRender": true, "asyncRender": true,
"asyncTestDiscourse": true,
"Blob": true, "Blob": true,
"bootbox": true, "bootbox": true,
"click": true, "click": true,
"waitUntil": true, "waitUntil": true,
"getSettledState": true, "getSettledState": true,
"collapseSelectKit": true,
"controllerFor": true,
"count": true, "count": true,
"currentPath": true, "currentPath": true,
"currentRouteName": true, "currentRouteName": true,
@ -32,11 +29,9 @@
"Discourse": true, "Discourse": true,
"Ember": true, "Ember": true,
"exists": true, "exists": true,
"expandSelectKit": true,
"File": true, "File": true,
"fillIn": true, "fillIn": true,
"find": true, "find": true,
"fixture": true,
"Handlebars": true, "Handlebars": true,
"hasModule": true, "hasModule": true,
"I18n": true, "I18n": true,

View File

@ -1,6 +1,6 @@
import DiscourseURL from "discourse/lib/url"; import DiscourseURL from "discourse/lib/url";
import ClickTrack from "discourse/lib/click-track"; 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", { QUnit.module("lib:click-track-edit-history", {
beforeEach() { beforeEach() {

View File

@ -1,6 +1,6 @@
import DiscourseURL from "discourse/lib/url"; import DiscourseURL from "discourse/lib/url";
import ClickTrack from "discourse/lib/click-track"; 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", { QUnit.module("lib:click-track-profile-page", {
beforeEach() { beforeEach() {

View File

@ -1,6 +1,6 @@
import DiscourseURL from "discourse/lib/url"; import DiscourseURL from "discourse/lib/url";
import ClickTrack from "discourse/lib/click-track"; 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", { QUnit.module("lib:click-track", {
beforeEach() { beforeEach() {

View File

@ -2,6 +2,7 @@ import {
default as highlightText, default as highlightText,
CLASS_NAME CLASS_NAME
} from "discourse/lib/highlight-text"; } from "discourse/lib/highlight-text";
import { fixture } from "helpers/qunit-helpers";
QUnit.module("lib:highlight-text"); QUnit.module("lib:highlight-text");

View File

@ -1,4 +1,5 @@
import PreloadStore from "preload-store"; import PreloadStore from "preload-store";
import { asyncTestDiscourse } from "helpers/qunit-helpers";
QUnit.module("preload-store", { QUnit.module("preload-store", {
beforeEach() { beforeEach() {

View File

@ -1,4 +1,5 @@
import { registerTooltip, registerHoverTooltip } from "discourse/lib/tooltip"; import { registerTooltip, registerHoverTooltip } from "discourse/lib/tooltip";
import { fixture } from "helpers/qunit-helpers";
// prettier-ignore // prettier-ignore
QUnit.module("lib:tooltip", { QUnit.module("lib:tooltip", {

View File

@ -4,6 +4,7 @@ import {
resetCache resetCache
} from "pretty-text/upload-short-url"; } from "pretty-text/upload-short-url";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";
import { fixture } from "helpers/qunit-helpers";
QUnit.module("lib:pretty-text/upload-short-url", { QUnit.module("lib:pretty-text/upload-short-url", {
beforeEach() { beforeEach() {

View File

@ -176,11 +176,6 @@ QUnit.testDone(function() {
// Load ES6 tests // Load ES6 tests
var helpers = require("helpers/qunit-helpers"); 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) { function getUrlParameter(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");