Add test of sending Buffer
This commit is contained in:
parent
a97b40eff5
commit
554e944105
1 changed files with 10 additions and 1 deletions
|
@ -286,7 +286,7 @@ describe('ipc module', function () {
|
|||
ipcRenderer.send('message', obj)
|
||||
})
|
||||
|
||||
it('can send instance of Date', function (done) {
|
||||
it('can send instances of Date', function (done) {
|
||||
const currentDate = new Date()
|
||||
ipcRenderer.once('message', function (event, value) {
|
||||
assert.equal(value, currentDate.toISOString())
|
||||
|
@ -295,6 +295,15 @@ describe('ipc module', function () {
|
|||
ipcRenderer.send('message', currentDate)
|
||||
})
|
||||
|
||||
it('can send instances of Buffer', function (done) {
|
||||
var buffer = Buffer.from('hello')
|
||||
ipcRenderer.once('message', function (event, message) {
|
||||
assert.ok(buffer.equals(message))
|
||||
done()
|
||||
})
|
||||
ipcRenderer.send('message', buffer)
|
||||
})
|
||||
|
||||
it('can send objects with DOM class prototypes', function (done) {
|
||||
ipcRenderer.once('message', function (event, value) {
|
||||
assert.equal(value.protocol, 'file:')
|
||||
|
|
Loading…
Reference in a new issue