Created
March 3, 2017 17:21
-
-
Save avaly/b50d0d1d7635aeac101406f9aedb3e2d to your computer and use it in GitHub Desktop.
ava-babel-await
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
"@ava/stage-4", | |
["es2015", { "modules": "commonjs" }], | |
"stage-1" | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default () => { | |
return new Promise((resolve) => { | |
setTimeout(() => resolve('bar'), 500); | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test from 'ava'; | |
import foo from './foo'; | |
test('async', async t => { | |
t.is(await foo(), 'bar'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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