From 7fcf4dcd4bf7281c1f373c09ac93c384f58e0e62 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Wed, 23 Mar 2022 14:28:09 +0100 Subject: [PATCH] FIX: Allow `@ember/test` import in embercli prod builds (#16264) This matches the behavior of legacy discourse-loader and the regular Ember resolver. --- app/assets/javascripts/discourse/lib/rfc176-shims/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = "";