mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
REFACTOR: Move javascript tests inside discourse app
This is where they should be as far as ember is concerned. Note this is a huge commit and we should be really careful everything continues to work properly.
This commit is contained in:
@ -1,12 +1,17 @@
|
||||
var define, requirejs;
|
||||
|
||||
(function () {
|
||||
var JS_MODULES = {};
|
||||
var ALIASES = {
|
||||
let JS_MODULES = {};
|
||||
const ALIASES = {
|
||||
"ember-addons/ember-computed-decorators":
|
||||
"discourse-common/utils/decorators",
|
||||
"discourse/lib/raw-templates": "discourse-common/lib/raw-templates",
|
||||
"preload-store": "discourse/lib/preload-store",
|
||||
"fixtures/user_fixtures": "discourse/tests/fixtures/user-fixtures",
|
||||
};
|
||||
const ALIAS_PREPEND = {
|
||||
fixtures: "discourse/tests/",
|
||||
helpers: "discourse/tests/",
|
||||
};
|
||||
|
||||
// In future versions of ember we don't need this
|
||||
@ -299,11 +304,15 @@ var define, requirejs;
|
||||
}
|
||||
|
||||
function transformForAliases(name) {
|
||||
var alias = ALIASES[name];
|
||||
let alias = ALIASES[name];
|
||||
if (!alias) {
|
||||
return name;
|
||||
let segment = name.split("/")[0];
|
||||
let prepend = ALIAS_PREPEND[segment];
|
||||
if (!prepend) {
|
||||
return name;
|
||||
}
|
||||
alias = prepend + name;
|
||||
}
|
||||
|
||||
deprecatedModule(name, alias);
|
||||
return alias;
|
||||
}
|
||||
|
Reference in New Issue
Block a user