Skip to content
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

Remove support for running the test file directly with node #97

Closed
sindresorhus opened this issue Oct 24, 2015 · 5 comments · Fixed by #98
Closed

Remove support for running the test file directly with node #97

sindresorhus opened this issue Oct 24, 2015 · 5 comments · Fixed by #98
Labels
enhancement new functionality

Comments

@sindresorhus
Copy link
Member

It's nice in theory to be able to node test.js, but the reality is that it complicates the code a lot and by using it that way you miss out on the best features of AVA. It also create diverging code paths that just becomes harder to maintain.

This would also fix #52.

@vdemedes I guess we can remove https://github.com/sindresorhus/ava/blob/c96622d6d8785719d16aa83d129cb5ffccbf9add/index.js#L75-L86 now. Anything else that can be removed/simplified because of this?

@schnittstabil
Copy link

With #83, removing does not have to be a real "either-or decision". It would be up to the user:

// test.js
import test from 'ava';

test(t => {
    t.pass();
    t.end();
});

test.runAndExit(); // or a similar one-liner

@sindresorhus
Copy link
Member Author

@schnittstabil The programmatic API is meant for running the tests, not be used in the test file itself.

@timoxley
Copy link
Contributor

Would be good to reverse this decision… the ability to run tests without the ava process simplifies things as it removes any complications and potentially subtle bugs created by having different versions of AVA installed globally and in node_modules/.bin, even if it required additional hoops such as loading a bootstrap file first e.g. via the node --require flag.

@sindresorhus
Copy link
Member Author

@timoxley Yes, we intend to, but shouldn't be default as it will (and did) cause subtle bugs.

Follow: #111

@timoxley
Copy link
Contributor

@sindresorhus ty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants