Skip to content

Commit

Permalink
fix(config): ensure basePath is always resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiebel committed Apr 2, 2013
1 parent 39f9d66 commit 2e5c5aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ var parseConfig = function(configFilePath, cliOptions) {
// always ignore the config file itself
config.exclude.push(configFilePath);
}
else {
config.basePath = path.resolve(config.basePath);
}

return normalizeConfig(config);
};
Expand Down
6 changes: 6 additions & 0 deletions test/unit/config.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ describe 'config', ->
expect(config.basePath).to.equal resolveWinPath('/some') # overriden by CLI
expect(config.urlRoot).to.equal '/' # default value

it 'should not read config file, when null but still resolve cli basePath', ->
config = e.parseConfig null, {basePath: './some' }

expect(logSpy).not.to.have.been.called
expect(config.basePath).to.equal resolveWinPath('./some')
expect(config.urlRoot).to.equal '/' # default value

describe 'normalizeConfig', ->

Expand Down

0 comments on commit 2e5c5aa

Please sign in to comment.