Add spec for remote Promise
This commit is contained in:
parent
ddf2cfd48d
commit
c7d1f4f6b2
2 changed files with 12 additions and 0 deletions
|
@ -52,6 +52,15 @@ describe 'ipc module', ->
|
||||||
print_name = remote.require path.join(fixtures, 'module', 'print_name.js')
|
print_name = remote.require path.join(fixtures, 'module', 'print_name.js')
|
||||||
assert.equal print_name.print(buf), 'Buffer'
|
assert.equal print_name.print(buf), 'Buffer'
|
||||||
|
|
||||||
|
describe 'remote promise in renderer', ->
|
||||||
|
it 'can be used as promise', (done) ->
|
||||||
|
promise = remote.require path.join(fixtures, 'module', 'promise.js')
|
||||||
|
promise.toPromise(1234)
|
||||||
|
.then (value) => value * 2
|
||||||
|
.then (value) =>
|
||||||
|
assert.equal value, 2468
|
||||||
|
done()
|
||||||
|
|
||||||
describe 'ipc.sender.send', ->
|
describe 'ipc.sender.send', ->
|
||||||
it 'should work when sending an object containing id property', (done) ->
|
it 'should work when sending an object containing id property', (done) ->
|
||||||
obj = id: 1, name: 'ly'
|
obj = id: 1, name: 'ly'
|
||||||
|
|
3
spec/fixtures/module/promise.js
vendored
Normal file
3
spec/fixtures/module/promise.js
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
exports.toPromise = function (value) {
|
||||||
|
return Promise.resolve(value);
|
||||||
|
};
|
Loading…
Reference in a new issue