Skip to content

Instantly share code, notes, and snippets.

@avaly
Created March 3, 2017 17:21
Show Gist options
  • Save avaly/b50d0d1d7635aeac101406f9aedb3e2d to your computer and use it in GitHub Desktop.
Save avaly/b50d0d1d7635aeac101406f9aedb3e2d to your computer and use it in GitHub Desktop.
ava-babel-await
{
"presets": [
"@ava/stage-4",
["es2015", { "modules": "commonjs" }],
"stage-1"
]
}
export default () => {
return new Promise((resolve) => {
setTimeout(() => resolve('bar'), 500);
});
};
import test from 'ava';
import foo from './foo';
test('async', async t => {
t.is(await foo(), 'bar');
});
{
"name": "ava-babel-await",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "ava"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@ava/babel-preset-stage-4": "^1.0.0",
"ava": "^0.18.2",
"babel-core": "^6.23.1",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-stage-1": "^6.22.0"
},
"ava": {
"babel": "inherit",
"require": [
"babel-register"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment