mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add spec for remote setter not surfacing error
This commit is contained in:
@@ -187,6 +187,18 @@ describe('ipc module', function () {
|
||||
property.property = 1127
|
||||
})
|
||||
|
||||
it('rethrows errors getting/setting properties', function () {
|
||||
const foo = remote.require(path.join(fixtures, 'module', 'error-properties.js'))
|
||||
|
||||
assert.throws(function () {
|
||||
foo.bar
|
||||
}, /getting error/)
|
||||
|
||||
assert.throws(function () {
|
||||
foo.bar = 'test'
|
||||
}, /setting error/)
|
||||
})
|
||||
|
||||
it('can construct an object from its member', function () {
|
||||
var call = remote.require(path.join(fixtures, 'module', 'call.js'))
|
||||
var obj = new call.constructor()
|
||||
|
||||
11
spec/fixtures/module/error-properties.js
vendored
Normal file
11
spec/fixtures/module/error-properties.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
set bar (value) {
|
||||
throw new Error('setting error')
|
||||
}
|
||||
|
||||
get bar () {
|
||||
throw new Error('getting error')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Foo()
|
||||
Reference in New Issue
Block a user