1 | #!/usr/bin/env node
|
2 | var Cucumber = require('../lib/cucumber');
|
3 | var cli = Cucumber.Cli(process.argv);
|
4 | cli.run(function (succeeded) {
|
5 | var code = succeeded ? 0 : 1;
|
6 |
|
7 | process.on('exit', function () {
|
8 | process.exit(code);
|
9 | });
|
10 |
|
11 | var timeoutId = setTimeout(function () {
|
12 | console.error('Cucumber process timed out after waiting 60 seconds for the node.js event loop to empty. There may be a resource leak. Have all resources like database connections and network connections been closed properly?');
|
13 | process.exit(code);
|
14 | }, 60 * 1000);
|
15 |
|
16 | if (timeoutId.unref) {
|
17 | timeoutId.unref();
|
18 | }
|
19 | else {
|
20 | clearTimeout(timeoutId);
|
21 | }
|
22 | });
|