mhevery / jasmine-node

Integration of Jasmine Spec framework with Node.js
MIT License
1.52k stars 292 forks source link

Can't run jasmine-node with node 4 using ES6a #386

Closed indigo0086 closed 6 years ago

indigo0086 commented 9 years ago

Running jasmine-node using node 4 against a spec file that uses es6 generates the following error in the presence of any es6 specific syntax.

[SyntaxError: Unexpected reserved word]
noahzgordon commented 8 years ago

+1

jan-osch commented 8 years ago

+1

suhasdeshpande commented 8 years ago

Is there any resolution on this one??

diogommartins commented 8 years ago

jasmine-node doesn't work with ES6 syntax. you have to use something like babel to compile it. My testing routine for my npm package.json is

"scripts": {
    "pretest": "babel src --out-dir lib && babel spec/*.es6 --out-dir .",
    "test": "./node_modules/.bin/jasmine-node --verbose --captureExceptions spec",
    "compile": "babel src --out-dir lib",
    "prepublish": "npm test && npm run compile",
    "doc": "esdoc -c ./esdoc.json"
  },
erajune commented 8 years ago

@diogommartins Which babel did you install?

diogommartins commented 8 years ago

@erajune I'm currently using

"devDependencies": {
    "babel-cli": "^6.0.0",
    "babel-polyfill": "^6.8.0",
    "babel-preset-es2015": "^6.6.0",
    "jasmine-node": "^1.14.5"
}
brodycj commented 6 years ago

This looks like the request is for something beyond the scope of this project. Marked as a feature request that will be declined, especially considering this project is now in maintenance mode.