1

I'm using gulp to run mocha tests, It seems to fail with es7 syntax like async await and stuff, I'm using node version 10 in which the async await are supported, when I run test with mocha test/sample.js

it works , when I run the same via gulp it fails with

events.js:167
      throw er; // Unhandled 'error' event
      ^
Error: Unable to parse /Users/**/**/**/**/media-templates.js

Line 20: Unexpected token function

Line 20 in media-templates.js looks like below

mediaTemplate.pre('save', async function () {

I'm not using any trans compilers like babel as node 10 supports these things.

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
Hari
  • 452
  • 1
  • 6
  • 16

0 Answers0