Hello,
I'm playing with --no-compat mode, and found that current setup of isTesting macro is done too late.
Because macroCondition(isTesting()) can be called everywhere eq. app/add-on module's scope, it seems necessary to setup macros before any import of app/add-on code.
Using following example worked for me, does this make sense?
<script type="module">
window._embroider_macros_runtime_config ??= [];
window._embroider_macros_runtime_config.push((config) => {
config.getGlobalConfig()["@embroider/macros"].isTesting = true;
});
</script>
<script type="module">
import { start } from './test-helper';
import.meta.glob("./**/*.{js,ts,gjs,gts}", { eager: true });
start();
</script>
Hello,
I'm playing with
--no-compatmode, and found that current setup ofisTestingmacro is done too late.Because
macroCondition(isTesting())can be called everywhere eq. app/add-on module's scope, it seems necessary to setup macros before any import of app/add-on code.Using following example worked for me, does this make sense?