From 0335ae4e0710768b2f297c5670e4f1640944da34 Mon Sep 17 00:00:00 2001 From: Benjamin Petetot Date: Mon, 23 Sep 2024 16:36:02 +0200 Subject: [PATCH] fix(mon-pix): fix glimmer unit tests with code splitting --- mon-pix/ember-cli-build.js | 4 ++-- mon-pix/tests/helpers/create-glimmer-component.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mon-pix/ember-cli-build.js b/mon-pix/ember-cli-build.js index 3bce0a4b9e0..ed152acbebf 100644 --- a/mon-pix/ember-cli-build.js +++ b/mon-pix/ember-cli-build.js @@ -50,9 +50,9 @@ module.exports = function (defaults) { return require('@embroider/compat').compatBuild(app, Webpack, { staticAddonTestSupportTrees: true, staticAddonTrees: true, - staticHelpers: true, staticModifiers: true, - staticComponents: true, + staticHelpers: app.env === 'production', + staticComponents: app.env === 'production', packagerOptions: { webpackConfig: { devtool: sourceMapConfig[process.env.CI ? 'test' : (process.env.NODE_ENV ?? 'default')], diff --git a/mon-pix/tests/helpers/create-glimmer-component.js b/mon-pix/tests/helpers/create-glimmer-component.js index 56aebc78fe0..7aa1deea4c0 100644 --- a/mon-pix/tests/helpers/create-glimmer-component.js +++ b/mon-pix/tests/helpers/create-glimmer-component.js @@ -3,7 +3,7 @@ import GlimmerComponentManager from '@glimmer/component/-private/ember-component export default function createComponent(lookupPath, named = {}) { const { owner } = getContext(); - const { class: componentClass } = owner.factoryFor(lookupPath); + const { class: componentClass } = owner.factoryFor(`component:${lookupPath}`); const componentManager = new GlimmerComponentManager(owner); return componentManager.createComponent(componentClass, { named }); }