REFACTOR: Support importing of Pretender

We shouldn't be using global variables for libraries.
This commit is contained in:
Robin Ward 2020-10-05 13:29:51 -04:00
parent f30c5a5c3a
commit 39ad9a4734
4 changed files with 9 additions and 3 deletions

View File

@ -150,6 +150,9 @@ var define, requirejs;
// eslint-disable-next-line
default: I18n,
},
pretender: {
default: window.Pretender,
},
};
}

View File

@ -1,4 +1,5 @@
import User from "discourse/models/user";
import Pretender from "pretender";
export function parsePostData(query) {
const result = {};

View File

@ -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

View File

@ -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.