Skip to content

How should the test interface be configured? #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mdibaiee opened this issue Sep 3, 2015 · 3 comments
Closed

How should the test interface be configured? #34

mdibaiee opened this issue Sep 3, 2015 · 3 comments
Labels

Comments

@mdibaiee
Copy link

mdibaiee commented Sep 3, 2015

Currently we don't have any options, no configuration, but we will need such thing as we go further.

As @sindresorhus said in this comment we can read CLI arguments using process.argv, but there should be a real API for configuring test interface, like this:

var test = require('ava');
test.config({ fullTrace: true });

If we have this, we can extend the config with CLI arguments. Individual tests' configurations should override CLI arguments.

Blocks #29 #31

@sindresorhus Please label as question.

@sindresorhus
Copy link
Member

I don't think there should be. The public interface should be as simple and config-less a possible.

The flags are something we will handle internally, not in the public API. It will be passed to the Runner which will handle the changes, like making everything serial for the --debug flag.

@mdibaiee
Copy link
Author

mdibaiee commented Sep 4, 2015

@sindresorhus Then how should we check for flags inside test interface? Probably a helper function like this?

function hasFlag(key) {
  return process.argv.indexOf(`--${key}`) > -1 || process.argv.indexOf(`-${key}`) > -1;
}

@sindresorhus
Copy link
Member

Yes, we can use something like has-flag.

@mdibaiee mdibaiee closed this as completed Sep 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants