Skip to content

Commit

Permalink
fix: (#266) fix headlessConfig() setter (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakewilson authored Jun 11, 2021
1 parent c01f2b0 commit bb28213
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function headlessConfig(config?: HeadlessConfig): HeadlessConfig {
}

configSet = true;
wpeConfig = normalizeConfig(wpeConfig);
wpeConfig = normalizeConfig(config);

return wpeConfig;
}
9 changes: 9 additions & 0 deletions packages/core/test/config/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ describe('config/config', () => {
expect(headlessConfig()).toBe(config);
});

test('headlessConfig() should return the set wpUrl', () => {
const cfg = {
wpUrl: 'http://wpengine.com',
};

let config = headlessConfig(cfg);
expect(config.wpUrl).toBe(cfg.wpUrl);
});

test('headlessConfig() arguments should be immutable', () => {
const cfg = {
wpUrl: '',
Expand Down

0 comments on commit bb28213

Please sign in to comment.