Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Mar 13, 2024
1 parent 982020c commit 2beb5bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/fixtures/configfiles/override-config-path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"myappfile": "./override-the-config-path.js"
}
15 changes: 15 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,21 @@ describe('Liftoff', function () {
);
});

it('overrides the configPath if the configName key exists in the config', function (done) {
var app = new Liftoff({
name: 'myapp',
configFiles: {
'override-config-path': [
{ path: 'test/fixtures/configfiles', extensions: ['.js', '.json'] }
],
},
});
app.prepare({}, function (env) {
expect(env.configPath).toEqual('./override-the-config-path.js');
done();
});
});

it('should use dirname of configPath if no cwd is specified', function (done) {
var app = new Liftoff({
name: 'myapp',
Expand Down

0 comments on commit 2beb5bf

Please sign in to comment.