Npm test -t <any test>

Something seems to be wrong with my setup I guess. This is the error I get when I try to run any test case through npm.

module.exports = async function() {

SyntaxError: Unexpected token function
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at //mflix-js/node_modules/jest-cli/build/runJest.js:441:27

Hi @Sagar_69755,

Please make sure you are using updated version of Nodejs. If it is updated, please let me know which version you are using.


It was a pretty old version (6.x). Upgraded and resolved.