I'm using Testcafe runner to execute some tests i got. When everything is finished the console remains executing the script forever.
Here is my code:
createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
runner = testcafe.createRunner();
return runner
.src(['offerRefresh.js'])
.browsers(['nightmare'])
.screenshots('./screenshots', true)
.run();
})
.then(failedCount => {
console.log('Tests failed: ' + failedCount);
testcafe.close();
});
The console remains like this:
Tests failed: 0
And never closes the process.