midniteio / multi-cuke

Parallel cucumber-js testing via Node's child_process.spawn api
13 stars 4 forks source link

TypeError: multicuke(options) is not a function #61

Closed guptarajatkn closed 7 years ago

guptarajatkn commented 7 years ago

I have runMultiFeature.js having following code :

const multicuke = require('multi-cuke');
var options = {
    'paths': ['./login.feature'],
    'tags': [],
    'requires': ['./ui'],
    'cucumberPath': "node_modules/cucumber/bin/cucumber.js",
    'workers': 4,
    'workerEnvVars': {},
    'logDir': '.multiCuke_logs',
    'silentSummary': false,
    'verbose': false,
    'inlineStream': false,
    'failFast': false,
    'devMode': false,
    'strict': false
};
multicuke(options);

and executing the .js file using "node runMultiFeature.js"

getting following error: multicuke(); ^

TypeError: multicuke is not a function at Object. (C:\UI_automation_201016\runMultiFeature.js:17:1) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:141:18) at node.js:933:3

midniteio commented 7 years ago

Hi @guptarajatkn, looks like we have some wrong documentation. This would work with require('multi-cuke').default, but that's not so friendly. I'll open a PR and tag you in it to get this resolved. Sorry for delay in responding, I've also just set up a gitter for this project if you'd like to reach out in the future: https://gitter.im/multi-cuke/Lobby#

midniteio commented 7 years ago

This is going to be hard to resolve without killing backwards compatibility for others using this library unfortunately. I've updated the readme to reflect what you would need to use (if using require, then you would need to require('multi-cuke').default, if using es6/babel: import multicuke from 'multi-cuke').

Going to close this as changing the api of the behavior would introduce breakages, and will consider this change for v1