Skip to content

Setting isTesting = true in enterTestMode() is too late #175

Description

@bobisjan

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions