REFACTOR: Support importing of `Pretender`

REFACTOR: Support importing of Pretender

We shouldn’t be using global variables for libraries.

diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js
index 7682617..3586997 100644
--- a/app/assets/javascripts/discourse-loader.js
+++ b/app/assets/javascripts/discourse-loader.js
@@ -150,6 +150,9 @@ var define, requirejs;
         // eslint-disable-next-line
         default: I18n,
       },
+      pretender: {
+        default: window.Pretender,
+      },
     };
   }
 
diff --git a/app/assets/javascripts/discourse/tests/helpers/create-pretender.js b/app/assets/javascripts/discourse/tests/helpers/create-pretender.js
index fd4f741..2677a11 100644
--- a/app/assets/javascripts/discourse/tests/helpers/create-pretender.js
+++ b/app/assets/javascripts/discourse/tests/helpers/create-pretender.js
@@ -1,4 +1,5 @@
 import User from "discourse/models/user";
+import Pretender from "pretender";
 
 export function parsePostData(query) {
   const result = {};
diff --git a/app/assets/javascripts/wizard/test/test_helper.js b/app/assets/javascripts/wizard/test/test_helper.js
index 1a48e24..abb3269 100644
--- a/app/assets/javascripts/wizard/test/test_helper.js
+++ b/app/assets/javascripts/wizard/test/test_helper.js
@@ -6,6 +6,9 @@
 //= require ember.debug
 //= require locales/i18n
 //= require locales/en_US
+//= require route-recognizer/dist/route-recognizer
+//= require fake_xml_http_request
+//= require pretender/pretender
 //= require discourse-loader
 //= require jquery.debug
 //= require handlebars
@@ -19,9 +22,6 @@
 //= require_tree ./acceptance
 //= require_tree ./models
 //= require_tree ./components
-//= require fake_xml_http_request
-//= require route-recognizer/dist/route-recognizer
-//= require pretender/pretender
 //= require ./wizard-pretender
 
 // Trick JSHint into allow document.write
diff --git a/app/assets/javascripts/wizard/test/wizard-pretender.js b/app/assets/javascripts/wizard/test/wizard-pretender.js
index 96ca235..e9dccfb 100644
--- a/app/assets/javascripts/wizard/test/wizard-pretender.js
+++ b/app/assets/javascripts/wizard/test/wizard-pretender.js
@@ -1,3 +1,5 @@
+import Pretender from "pretender";
+
 // TODO: This file has some copied and pasted functions from `create-pretender` - would be good
 // to centralize that code at some point.
 

GitHub sha: 39ad9a47

This commit appears in #10826 which was approved by CvX. It was merged by eviltrout.