mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 02:36:18 +08:00
d10f95bfad
We use that import also outside of tests…
65 lines
1.3 KiB
JavaScript
65 lines
1.3 KiB
JavaScript
// discourse-skip-module
|
|
|
|
define("sinon", () => {
|
|
return { default: window.sinon };
|
|
});
|
|
define("qunit", () => {
|
|
return {
|
|
default: window.QUnit,
|
|
test: window.QUnit.test,
|
|
skip: window.QUnit.skip,
|
|
module: window.QUnit.module,
|
|
};
|
|
});
|
|
define("ember-qunit", () => {
|
|
return {
|
|
moduleFor: window.moduleFor,
|
|
moduleForComponent: window.moduleForComponent,
|
|
};
|
|
});
|
|
define("htmlbars-inline-precompile", () => {
|
|
return {
|
|
default: function (str) {
|
|
// eslint-disable-next-line no-undef
|
|
return Ember.HTMLBars.compile(str[0]);
|
|
},
|
|
};
|
|
});
|
|
|
|
let _app;
|
|
define("@ember/test-helpers", () => {
|
|
let helpers = {
|
|
setApplication(app) {
|
|
_app = app;
|
|
},
|
|
getApplication() {
|
|
return _app;
|
|
},
|
|
async settled() {
|
|
// eslint-disable-next-line no-undef, discourse-ember/global-ember
|
|
Ember.run(() => {});
|
|
},
|
|
TestModuleForComponent: window.TestModuleForComponent,
|
|
};
|
|
[
|
|
"click",
|
|
"visit",
|
|
"currentURL",
|
|
"currentRouteName",
|
|
"fillIn",
|
|
"setResolver",
|
|
"triggerEvent",
|
|
].forEach((attr) => {
|
|
helpers[attr] = function () {
|
|
return window[attr](...arguments);
|
|
};
|
|
});
|
|
helpers.triggerKeyEvent = function () {
|
|
return window.keyEvent(...arguments);
|
|
};
|
|
return helpers;
|
|
});
|
|
define("pretender", () => {
|
|
return { default: window.Pretender };
|
|
});
|