Skip to content

Commit

Permalink
make sure that config is from the test envrionment when running /tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Apr 6, 2022
1 parent def95f0 commit 937e45b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions addon/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import { getOwnConfig } from '@embroider/macros';
import { isTesting, macroCondition, getOwnConfig } from '@embroider/macros';

export default getOwnConfig().config;
let config;

if (macroCondition(isTesting())) {
config = getOwnConfig().testConfig;
} else {
config = getOwnConfig().config;
}

export default config;
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ module.exports = {

included() {
this._super.included.apply(this, arguments);

this.options['@embroider/macros'].setOwnConfig.config = findRoot(
this
).project.config(process.env.EMBER_ENV);

this.options['@embroider/macros'].setOwnConfig.testConfig =
findRoot(this).project.config('test');
},
};

0 comments on commit 937e45b

Please sign in to comment.