Skip to content

Commit

Permalink
Merge pull request #1037 from bertdeblock/remove-passing-a-project-in…
Browse files Browse the repository at this point in the history
…stance-to-a-config-function
  • Loading branch information
kategengler authored Jan 16, 2025
2 parents 4547c62 + b6a1c8c commit 8618294
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion lib/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function getBaseConfig(options) {
if (fs.existsSync(configPath)) {
let configData = await require(configPath);

data = typeof configData === 'function' ? await configData(options.project) : configData;
data = typeof configData === 'function' ? await configData() : configData;
} else {
debug('Config file does not exist %s', configPath);
}
Expand Down
12 changes: 0 additions & 12 deletions test/utils/config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,6 @@ describe('utils/config', () => {
});
});

it('config file exporting a function is passed the project', () => {
generateConfigFile(
'module.exports = function(project) { return { scenarios: [ { foo: project.blah }] } };',
);

project.blah = 'passed-in';
return getConfig({ project }).then((config) => {
expect(config.scenarios).to.have.lengthOf(1);
expect(config.scenarios[0].foo).to.equal('passed-in');
});
});

it('throws error if project.root/config/ember-try.js is not present and no versionCompatibility', () => {
return getConfig({ project }).catch((error) => {
expect(error).to.match(
Expand Down

0 comments on commit 8618294

Please sign in to comment.