Skip to content

Commit

Permalink
test(new config module): maintain the macro-sample-addon scenario by …
Browse files Browse the repository at this point in the history
…moving the update of the config on fixture side
  • Loading branch information
BlueCutOfficial committed May 30, 2024
1 parent dbe4523 commit 52a94f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/addon-template/tests/dummy/app/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import loadConfigFromMeta from '@embroider/config-meta-loader';

export default loadConfigFromMeta('dummy');
// config.APP.fromConfigModule = 'hello new world';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import loadConfigFromMeta from '@embroider/config-meta-loader';

let config = loadConfigFromMeta('dummy');
config.APP.fromConfigModule = 'hello new world';

export default config;
3 changes: 3 additions & 0 deletions tests/scenarios/macro-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ function dummyAppScenarioSetup(project: Project) {
this._super.included.apply(this, arguments);
},
contentFor(type, config, contents) {
// This if block is used only by macro-sample-addon-classic, which does not build with Embroider.
// When building with Embroider, the responsibility for the config is moved to the app.
// Therefore, macro-sample-addon scenario defines 'fromConfigModule' differently using fixtures.
if (type === 'config-module') {
const originalContents = contents.join('');
contents.splice(0, contents.length);
Expand Down

0 comments on commit 52a94f4

Please sign in to comment.