File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,13 @@ module.exports = async function (defaults) {
55553. Finally, use the ` @embroider/ macros` config value for ` startMirageWithApp` in ` app/ app .js ` to conditionally start mirage:
5656
5757` ` ` js
58- import { macroCondition , importSync , getOwnConfig } from ' @embroider/macros' ;
58+ import { macroCondition , importSync , getOwnConfig , isTesting } from ' @embroider/macros' ;
5959
60- if (macroCondition (getOwnConfig ().startMirageWithApp )) {
60+ if (macroCondition (getOwnConfig ().startMirageWithApp && ! isTesting () )) {
6161 const startServer = importSync (' api/mirage/config' ).default ;
6262 startServer ({});
6363}
6464` ` `
65-
6665## Installation
6766
6867See monorepo README for installation instructions.
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ import Application from '@ember/application';
77import Resolver from 'ember-resolver' ;
88import loadInitializers from 'ember-load-initializers' ;
99import config from 'admin/config/environment' ;
10- import { macroCondition , importSync , getOwnConfig } from '@embroider/macros' ;
10+ import {
11+ macroCondition ,
12+ importSync ,
13+ getOwnConfig ,
14+ isTesting ,
15+ } from '@embroider/macros' ;
1116
1217export default class App extends Application {
1318 modulePrefix = config . modulePrefix ;
@@ -17,7 +22,7 @@ export default class App extends Application {
1722
1823loadInitializers ( App , config . modulePrefix ) ;
1924
20- if ( macroCondition ( getOwnConfig ( ) . startMirageWithApp ) ) {
25+ if ( macroCondition ( getOwnConfig ( ) . startMirageWithApp && ! isTesting ( ) ) ) {
2126 const startServer = importSync ( 'api/mirage/config' ) . default ;
2227 startServer ( { } ) ;
2328}
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ import Application from '@ember/application';
77import Resolver from 'ember-resolver' ;
88import loadInitializers from 'ember-load-initializers' ;
99import config from './config/environment' ;
10- import { macroCondition , getOwnConfig , importSync } from '@embroider/macros' ;
10+ import {
11+ macroCondition ,
12+ getOwnConfig ,
13+ importSync ,
14+ isTesting ,
15+ } from '@embroider/macros' ;
1116
1217export default class App extends Application {
1318 modulePrefix = config . modulePrefix ;
@@ -17,7 +22,7 @@ export default class App extends Application {
1722
1823loadInitializers ( App , config . modulePrefix ) ;
1924
20- if ( macroCondition ( getOwnConfig ( ) . startMirageWithApp ) ) {
25+ if ( macroCondition ( getOwnConfig ( ) . startMirageWithApp && ! isTesting ( ) ) ) {
2126 const startServer = importSync ( 'api/mirage/config' ) . default ;
2227 startServer ( { } ) ;
2328}
You can’t perform that action at this time.
0 commit comments