1

Is there a standard framework for unit testing on IOJS? I'm trying to test server-side code that uses ES6 features. Currently I'm trying to use Mocha, which unfortunately is hard-coded to utilize node as it's platform. This wouldn't be so much of a problem - I could just use a transpiler - however I am also using the koa library, which makes extensive use of ES6 generators.

Unfortunately, mocha compilers do not transpile node_modules, which means I am unable to test any files that utilize the koa module.

It also seems fairly counterproductive for me to write my code for use on iojs but be forced to use node to test it.

I did at the io.js tag but this appears to be synonymized with the node one as I am unable to actually select it.

Ideas?

1 Answer 1

2

If you are depend from koa which doesn't work on node you have to use iojs. So, your question is how to run mocha under the iojs. Try this

iojs ./node_modules/mocha/bin/mocha

Here is more thoughts in issue #1498 in mocha repository

Sign up to request clarification or add additional context in comments.

1 Comment

I've been trying to use iojs - although I was trying to run the shell file in node_modules/.bin. Didn't realize there was a distinct mocha runner inside of it's node modules folder. I'll try it out and report back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.