mirror of
https://github.com/electron/electron.git
synced 2026-01-26 15:58:07 -05:00
Add failing spec for remote static members
This commit is contained in:
@@ -63,6 +63,16 @@ describe('ipc module', function () {
|
||||
assert.equal(a.foo.bar, 'baz')
|
||||
})
|
||||
|
||||
it('should work with static class members', function () {
|
||||
var a = remote.require(path.join(fixtures, 'module', 'remote-static.js'))
|
||||
assert.equal(typeof a.Foo, 'function')
|
||||
assert.equal(a.Foo.foo(), 3)
|
||||
assert.equal(a.Foo.bar, 'baz')
|
||||
|
||||
var foo = new a.Foo()
|
||||
assert.equal(foo.baz(), 123)
|
||||
})
|
||||
|
||||
it('handles circular references in arrays and objects', function () {
|
||||
var a = remote.require(path.join(fixtures, 'module', 'circular.js'))
|
||||
|
||||
|
||||
15
spec/fixtures/module/remote-static.js
vendored
Normal file
15
spec/fixtures/module/remote-static.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
class Foo {
|
||||
static foo() {
|
||||
return 3
|
||||
}
|
||||
|
||||
baz() {
|
||||
return 123
|
||||
}
|
||||
}
|
||||
|
||||
Foo.bar = 'baz'
|
||||
|
||||
module.exports = {
|
||||
Foo: Foo
|
||||
}
|
||||
Reference in New Issue
Block a user