Skip to content

Conversation

@geek
Copy link
Member

@geek geek commented Jun 8, 2016

Closes #598

@geek geek added the feature New functionality or improvement label Jun 8, 2016
@geek geek added this to the 10.7.2 milestone Jun 8, 2016
@geek geek assigned geek and cjihrig and unassigned geek Jun 8, 2016
test/run_cli.js Outdated
module.exports = (args, callback, root) => {

const cli = ChildProcess.spawn('node', [].concat(internals.labPath, args), { 'cwd' : root ? root : '.' });
const cli = ChildProcess.spawn('node', [].concat(internals.labPath, args), { cwd : root ? root : '.' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're here... root ? root : '.' could just be root || '.' I think.

@cjihrig
Copy link
Contributor

cjihrig commented Jun 8, 2016

Maybe I'm missing something, but where do I look to see what options are supported by this new file? Are the config options just the name of the long command line flags without the -- in front?

@geek
Copy link
Member Author

geek commented Jun 8, 2016

I will update the readme to make it clearer what the allowed options are. They are the same long names as the cli options.

@Marsup
Copy link
Contributor

Marsup commented Jun 8, 2016

Do you think we should be able to provide our own labrc or do you prefer a base labrc overridden through cli ?

@geek
Copy link
Member Author

geek commented Jun 12, 2016

@cjihrig should be ready to go. I would rather the file be .labrc instead of supporting .labrc.json and .lanrc.js.

@Marsup you can provide your own labrc, lab doesn't ship with one.

@Marsup
Copy link
Contributor

Marsup commented Jun 12, 2016

@geek I didn't mean that. You always have multiple test configuration, how do you intend to deal with that + rc ?

@geek
Copy link
Member Author

geek commented Jun 12, 2016

@Marsup the first one found closest to the heart of the project wins.

  1. Current directory
  2. Parent of current directory, until the root folder is encountered
  3. $HOME/.${apprc}

@cjihrig
Copy link
Contributor

cjihrig commented Jun 13, 2016

LGTM

@geek geek changed the title Support .labrc for configuration Support .labrc.js for configuration Jun 14, 2016
@geek geek merged commit 4d22872 into hapijs:master Jun 14, 2016
@geek geek deleted the labrc branch June 14, 2016 01:31
@yelworc
Copy link

yelworc commented Jun 14, 2016

Quick note: The removed default for NODE_ENV caught me by surprise – my tests were suddenly running with the wrong app configuration after updating lab...

@geek
Copy link
Member Author

geek commented Jun 14, 2016

@yelworc thanks for the report. I will investigate the issue, it shouldn't have happened because there is a default environment set in the runner https://github.com/hapijs/lab/blob/master/lib/runner.js#L40

@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support .labrc files for configuration defaults

5 participants