Ava js not working async await tests -


i trying use ava.js tests can't launch async/await. copy/paste example documentation , showed me error.

(async function(t) { syntaxerror: missing) after argument list. 

looks not compiled correctly , don't know did wrong. me please?

here code

test.spec.js

import test 'ava';  test(async t => {     const value = await promisefn();     t.true(value); }); 

package.json

{   "scripts": {     "test": "ava"   },   "devdependencies": {     "ava": "^0.16.0",     "ava-spec": "^1.0.1",     "babel-preset-es2015": "^6.18.0",     "tap-nyan": "0.0.2"   },   "ava": {     "babel": "inherit",     "require": [       "babel-register"     ]   } } 

and .babelrc

{   "presets": [     "es2015"   ] } 

async/await not transpiled using preset es2015.
should enable preset es2017 or latest.

another solution run test suite on node v7 since natively support async/await.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -