We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

JoshyRobot • 9 years ago

AVA does not support async out of the box, the documentation says all tests must be defined synchronously. https://github.com/avajs/av...

Niels • 9 years ago

It does support aysnc out of the box. It states: "You can specify synchronous and asynchronous tests. Tests are considered synchronous unless you return a promise or observable.". So if you return a promise from your test, AVA will wait for that promise to resolve (asynchronously).

The line you are referring to is about defining the tests themselves. You can only define them synchronously (which makes sense, because your tests should not depend on anything), but they can run asynchronously.

Robert Peters • 8 years ago

So simple copying and pasting the example doesn't work. Error: t.equal is not a function

Niels • 8 years ago

True, it should be t.is, I'll fix that

Ben Richter • 8 years ago

You didn't though ;)
There is a "t.deepEqual" for hardcore array and object comparison

eric_shinn • 8 years ago

Get'r dun!

Sudhir Gupta • 8 years ago

who say Only one work?
I am testing vueJS application
right now. i added 3 function and all passed.

https://uploads.disquscdn.c...

comedymood.com

Vitalik Zaidman • 8 years ago

Thanks for the great article!
I included it in my "links" section of my article "A Complete Guide to Testing JavaScript in 2017":
https://medium.com/powtoon-...

Albert Albala • 8 years ago

Great intro, thanks! Here is a very simple Docker image with some examples: https://github.com/dcycle/d...

Matteo Zancanella • 9 years ago

Great Post!! I have a couple of questions. I know angulajs comes down with karma. Would you say AVA is better?
Also , I think it would be cool to see a post on how to write a front-end SDK , best practices and advices.

Thank you !

Niels • 9 years ago

Hi, thanks for your comment. Karma and AVA are not completely comparable, karma is just a tool to run tests in browser environments, not a testing framework like AVA. If you want to run AVA in a more browser-like environment (maybe to do DOM testing) you could use jsdom https://github.com/sindreso.... My advice would be, try out multiple options and see which one suits you best. What do you mean exactly with a writing a 'front-end SDK'?