Skip to content

A platform for community discussion. Free, open, simple.

FIX: Allow `@ember/test` import in embercli prod builds (#16264)

Jarek Radosz7fcf4dcd4bf7
diff --git a/app/assets/javascripts/discourse/lib/rfc176-shims/index.js b/app/assets/javascripts/discourse/lib/rfc176-shims/index.js
index df26adac628..cb0bb9460cd 100644
--- a/app/assets/javascripts/discourse/lib/rfc176-shims/index.js
+++ b/app/assets/javascripts/discourse/lib/rfc176-shims/index.js
@@ -40,7 +40,11 @@ module.exports = {
m = modules[entry.module] = [];
}
- m.push(entry);
+ if (entry.module === "@ember/test") {
+ m.push({ ...entry, global: `(Ember.Test && ${entry.global})` });
+ } else {
+ m.push(entry);
+ }
}
let output = "";