Add spec for remote Promise

This commit is contained in:
Ryohei Ikegami 2015-07-31 14:32:07 +09:00
parent ddf2cfd48d
commit c7d1f4f6b2
2 changed files with 12 additions and 0 deletions

View file

@ -52,6 +52,15 @@ describe 'ipc module', ->
print_name = remote.require path.join(fixtures, 'module', 'print_name.js')
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', ->
it 'should work when sending an object containing id property', (done) ->
obj = id: 1, name: 'ly'

3
spec/fixtures/module/promise.js vendored Normal file
View file

@ -0,0 +1,3 @@
exports.toPromise = function (value) {
return Promise.resolve(value);
};