RisingStack / graphql-server

Example GraphQL server with Mongoose (MongoDB) and Node.js
MIT License
846 stars 102 forks source link

Add --harmony-generators for mocha #9

Open parkan opened 9 years ago

parkan commented 9 years ago

Tests will not run otherwise (node v0.12.7)

bash-3.2$ NODE_ENV=test mocha --compilers js:babel/register --require co-mocha $(find src -name *.spec.js)
/Users/arkadiy/mine/graphql-server/node_modules/koa/lib/application.js:179
function *respond(next) {
         ^
SyntaxError: Unexpected token *
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Module._extensions..js (module.js:478:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/arkadiy/mine/graphql-server/node_modules/babel-core/lib/api/register/node.js:214:7)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/arkadiy/mine/graphql-server/src/server/server.js:5:12)
    at Module._compile (module.js:460:26)
    at normalLoader (/Users/arkadiy/mine/graphql-server/node_modules/babel-core/lib/api/register/node.js:199:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/arkadiy/mine/graphql-server/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/arkadiy/mine/graphql-server/src/server/server.spec.js:8:32)
    at Module._compile (module.js:460:26)
    at normalLoader (/Users/arkadiy/mine/graphql-server/node_modules/babel-core/lib/api/register/node.js:199:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/arkadiy/mine/graphql-server/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at /Users/arkadiy/mine/graphql-server/node_modules/mocha/lib/mocha.js:216:27
    at Array.forEach (native)
    at Mocha.loadFiles (/Users/arkadiy/mine/graphql-server/node_modules/mocha/lib/mocha.js:213:14)
    at Mocha.run (/Users/arkadiy/mine/graphql-server/node_modules/mocha/lib/mocha.js:453:10)
    at Object.<anonymous> (/Users/arkadiy/mine/graphql-server/node_modules/mocha/bin/_mocha:393:18)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
hekike commented 9 years ago

@parkan I think this issue it outdated with the latest 4.x.x node. isn't it?

parkan commented 9 years ago

You're right, 4.X series doesn't need the flag (though everything else runs fine under 0.12.X)