ember-cli / ember-cli/ember-app-blueprint
Setting `isTesting = true` in `enterTestMode()` is too late
- Dominant language
- JavaScript
- Stars
- 9
- Forks
- 16
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 13
Description
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?
```html
window._embroider_macros_runtime_config ??= [];
window._embroider_macros_runtime_config.push((config) => {
config.getGlobalConfig()["@embroider/macros"].isTesting = true;
});
import { start } from './test-helper';
import.meta.glob("./**/*.{js,ts,gjs,gts}", { eager: true });
start();
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.