2014-09-04 11:05:10 +10:00
|
|
|
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,
|
2014-09-04 11:11:31 +10:00
|
|
|
duration: 1200
|
2014-09-04 11:05:10 +10:00
|
|
|
}
|
|
|
|
);
|
|
|
|
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'
|
2014-09-04 11:05:10 +10:00
|
|
|
);
|
|
|
|
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
|
|
|
);
|
|
|
|
|