Skip to content

Commit

Permalink
add test for loading all found config files
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Mar 16, 2024
1 parent 4bc795f commit 91de55b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,28 @@ describe('Liftoff', function () {
});
});

it('loads all config for every found configFile', function (done) {
var app = new Liftoff({
name: 'myapp',
configFiles: [
{ name: 'testconfig', path: 'test/fixtures/configfiles' },
{ name: 'testconfig', path: 'test/fixtures/configfiles-extends' },
],
});
app.prepare({}, function (env) {
expect(env.config).toEqual([
{
aaa: 'AAA',
},
{
aaa: 'AAA', // Comes from the base, which overrode `aaa: 'CCC'` in the `extends`
bbb: 'BBB', // Comes from the `extends`
},
]);
done();
});
});

it('loads config if a `configFiles` is found and makes it available with the same key on `config`', function (done) {
var app = new Liftoff({
name: 'myapp',
Expand Down

0 comments on commit 91de55b

Please sign in to comment.