node-ipc/testHarness/tests/test-harness-test/testHarnessClient.js

43 lines
1.2 KiB
JavaScript
Raw Normal View History

var ipc = require('../../../node-ipc');
ipc.config.id = __dirname.split('/');
ipc.config.id = ipc.config.id[ipc.config.id.length-1]
ipc.config.maxRetries=1;
ipc.connectTo(
'testHarness',
function(){
ipc.of.testHarness.on(
'connect',
function(){
ipc.of.testHarness.emit(
'start.test',
{
id : ipc.config.id,
duration: 1200
}
);
ipc.of.testHarness.emit(
'pass',
'test-harness-pass-test'
);
ipc.of.testHarness.emit(
'fail',
2014-09-06 13:35:37 +10:00
'test-harness-this-test-should-fail'
);
setTimeout(
function(){
//delay exit incase you want to test failure of start.test by modifying event name
ipc.of.testHarness.emit(
'end.test'
);
ipc.of.testHarness.disconnect();
},
1000
);
}
);
}
2014-09-05 11:50:23 +10:00
);