[Proposal] Use the Ava Test runner
See original GitHub issueAva is a new javascript test runner that claims to be futuristic. It built-in babel which allows us to write and run tests in ES2017 without the need of any other tool.
Only thing here is that it does not compile the source code, just the tests. As mentioned in ava’s README, this can be easily fixed by using babel-register which hooks into ava and transpiles ESNext code on the fly while running tests.
All it takes is this small snippet of code in package.json
:
"ava": {
"require": [
"babel-register"
]
}
For our use case (of small exercises), this completely eliminates the need for bundling tools like gulp and to maintain the huge gulpfile and pass it along to the users with each exercise. Only thing we need to pass to users is package.json
.
To demonstrate what it looks like I ported the first two exercises hello
and leap
to use ava tests in this repository. hello
uses the standard xunit
style that ava gives out of the box. While leap
uses the BDD style which is provided by ava-spec.
PS: I also took the opportunity to use the latest ES using babel-preset-env which addresses my previous issue #259.
If maintainers agree, I would like to work on this.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (12 by maintainers)
Top GitHub Comments
@tejasbubane I tried to reach you directly via gitter today-- I got so excited about this idea that I have opened a PR. @rchavarria if you would have a look too please, I think this will work. It may resolve a few other issues in the process.
I know other tools use the approach of extending the
package.json
file. Don’t spend too much time with that because I don’t even know if it’s possible or not. I was just speaking my mind, without knowing the possibilities of the tool. Sorry if that confused you 😞