Add spec for remote function with toString property
This commit is contained in:
parent
818738ce84
commit
648d3324fb
2 changed files with 8 additions and 1 deletions
|
@ -163,8 +163,11 @@ describe('ipc module', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns toString() of original function via toString()', function () {
|
it('returns toString() of original function via toString()', function () {
|
||||||
var readText = remote.clipboard.readText
|
const {readText} = remote.clipboard
|
||||||
assert(readText.toString().startsWith('function'))
|
assert(readText.toString().startsWith('function'))
|
||||||
|
|
||||||
|
var {functionWithToStringProperty} = remote.require(path.join(fixtures, 'module', 'to-string-non-function.js'))
|
||||||
|
assert.equal(functionWithToStringProperty.toString, 'hello')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
4
spec/fixtures/module/to-string-non-function.js
vendored
Normal file
4
spec/fixtures/module/to-string-non-function.js
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
function hello () {
|
||||||
|
}
|
||||||
|
hello.toString = 'hello'
|
||||||
|
module.exports = {functionWithToStringProperty: hello}
|
Loading…
Add table
Add a link
Reference in a new issue