mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 04:03:43 +08:00
dab2f2fdf4
Instead we use the inline `hbs` helper. Note in the non-Ember CLI version this will not actually inline compile, but it will still work for all our tests.
60 lines
1.2 KiB
JavaScript
60 lines
1.2 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) {
|
|
return Ember.HTMLBars.compile(str[0]);
|
|
},
|
|
};
|
|
});
|
|
|
|
let _app;
|
|
define("@ember/test-helpers", () => {
|
|
let helpers = {
|
|
setApplication(app) {
|
|
_app = app;
|
|
},
|
|
getApplication() {
|
|
return _app;
|
|
},
|
|
async settled() {
|
|
// No-op in pre ember-cli environment
|
|
},
|
|
TestModuleForComponent: window.TestModuleForComponent,
|
|
};
|
|
[
|
|
"click",
|
|
"visit",
|
|
"currentURL",
|
|
"currentRouteName",
|
|
"fillIn",
|
|
"setResolver",
|
|
].forEach((attr) => {
|
|
helpers[attr] = function () {
|
|
return window[attr](...arguments);
|
|
};
|
|
});
|
|
helpers.triggerKeyEvent = window.keyEvent;
|
|
return helpers;
|
|
});
|
|
define("pretender", () => {
|
|
return { default: window.Pretender };
|
|
});
|