From: Kevin Sawicki Date: Thu, 6 Apr 2017 16:47:33 +0000 (-0700) Subject: Add failing spec for fork --eval message bug X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f28b7a151ee8b5c9ccd197d7d92535f3b909788;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Add failing spec for fork --eval message bug --- diff --git a/spec/node-spec.js b/spec/node-spec.js index 98db1ef..07f562f 100644 --- a/spec/node-spec.js +++ b/spec/node-spec.js @@ -91,6 +91,16 @@ describe('node feature', function () { done() }) }) + + it('works when sending message to a forked process using the --eval argument', function (done) { + const source = "process.on('message', function (msg) { process.send(msg) })" + const forked = ChildProcess.fork('--eval', [source]) + forked.on('message', (message) => { + assert.equal(message, 'hello') + done() + }) + forked.send('hello') + }) }) describe('child_process.spawn', function () {