UNPKG

nightwatch

Version:

Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.

24 lines (18 loc) 481 B
const Nightwatch = require('../../index'); function runWorkerTask({argv, port1}) { const writeData = (data) => { data = data.toString().trim(); if (data){ port1.postMessage({ type: 'stdout', data: data }); } }; process.stdout.write = writeData; process.stderr.write = writeData; //send reports to main thread using message port process.port = port1; return Nightwatch.runTests(argv, {}); } module.exports = runWorkerTask;