Skip to content

Instantly share code, notes, and snippets.

@nitish24p
Created November 20, 2017 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nitish24p/daf0e9319d7044a35696c4e4081c26fa to your computer and use it in GitHub Desktop.
Save nitish24p/daf0e9319d7044a35696c4e4081c26fa to your computer and use it in GitHub Desktop.
initialise Ava
import test from 'ava';
function sum (a, b) {
return a + b;
}
test('foo is being tested', t => {
t.pass();
})
test('bar is being tested', async t => {
const bar = Promise.resolve('bar');
t.is(await bar, 'bar');
});
test('sum of 2 numbers', t => {
t.plan(2);
t.pass('this assertion passed');
t.is(sum(1, 2), 3);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment