mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add spec for changing remote object's properties.
This commit is contained in:
@@ -4,6 +4,8 @@ path = require 'path'
|
||||
remote = require 'remote'
|
||||
|
||||
describe 'ipc', ->
|
||||
fixtures = path.join __dirname, '..', 'fixtures'
|
||||
|
||||
describe 'remote.require', ->
|
||||
it 'should returns same object for the same module', ->
|
||||
dialog1 = remote.require 'dialog'
|
||||
@@ -11,9 +13,18 @@ describe 'ipc', ->
|
||||
assert.equal dialog1, dialog2
|
||||
|
||||
it 'should work when object contains id property', ->
|
||||
a = remote.require path.join(__dirname, '..', 'fixtures', 'module', 'id.js')
|
||||
a = remote.require path.join(fixtures, 'module', 'id.js')
|
||||
assert.equal a.id, 1127
|
||||
|
||||
describe 'remote object', ->
|
||||
it 'can change its properties', ->
|
||||
property = remote.require path.join(fixtures, 'module', 'property.js')
|
||||
assert.equal property.property, 1127
|
||||
property.property = 1007
|
||||
assert.equal property.property, 1007
|
||||
property2 = remote.require path.join(fixtures, 'module', 'property.js')
|
||||
assert.equal property2.property, 1007
|
||||
|
||||
describe 'ipc.send', ->
|
||||
it 'should work when sending an object containing id property', (done) ->
|
||||
obj = id: 1, name: 'ly'
|
||||
|
||||
1
spec/fixtures/module/property.js
vendored
Normal file
1
spec/fixtures/module/property.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
exports.property = 1127
|
||||
Reference in New Issue
Block a user