question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Proposal] Use the Ava Test runner

See original GitHub issue

Ava 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:closed
  • Created 6 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
matthewmorgancommented, Apr 29, 2017

@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.

0reactions
rchavarriacommented, Apr 26, 2017

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 😞

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Proposal] Use the Ava Test runner · Issue #272 · exercism/javascript ...
Ava is a new javascript test runner that claims to be futuristic. It built-in babel which allows us to write and run tests...
Read more >
How you can test your Node.js applications with Ava.js - Medium
Ava is a JavaScript test runner. It utilizes the async I/O nature of Node and runs concurrent tests, thereby vastly decreasing your test...
Read more >
AVA Tutorial - itenium
avajs/ava : Testing can be a drag. AVA helps you get it done. A concurrent test runner from the Andromeda galaxy.
Read more >
Ava Test Runner | Developer Guide - Nightwatch.js
Overview. Ava is a test runner for Node.js with a concise API, which embraces new language features, has detailed error output and process...
Read more >
AVA, low-config testing for JavaScript - Code with Hugo
AVA is a Futuristic JavaScript test runner. ... In the async cases, you can use t.plan to specify the number of assertions that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found