Add test for id property of remote object.
This commit is contained in:
parent
47686b3233
commit
511b2a4422
3 changed files with 20 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
|||
assert = require 'assert'
|
||||
ipc = require 'ipc'
|
||||
path = require 'path'
|
||||
remote = require 'remote'
|
||||
|
||||
describe 'ipc', ->
|
||||
|
@ -7,3 +9,15 @@ describe 'ipc', ->
|
|||
dialog1 = remote.require 'dialog'
|
||||
dialog2 = remote.require 'dialog'
|
||||
assert.equal dialog1, dialog2
|
||||
|
||||
it 'should work when object contains id property', ->
|
||||
a = remote.require path.join(__dirname, '..', 'fixtures', 'module', 'id.js')
|
||||
assert.equal a.id, 1127
|
||||
|
||||
describe 'ipc.send', ->
|
||||
it 'should work when sending an object containing id property', (done) ->
|
||||
obj = id: 1, name: 'ly'
|
||||
ipc.on 'message', (message) ->
|
||||
assert.deepEqual message, obj
|
||||
done()
|
||||
ipc.send obj
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue