diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index ecd79d2353..183adb01fc 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -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')) diff --git a/spec/fixtures/module/remote-static.js b/spec/fixtures/module/remote-static.js new file mode 100644 index 0000000000..524d9b96d8 --- /dev/null +++ b/spec/fixtures/module/remote-static.js @@ -0,0 +1,15 @@ +class Foo { + static foo() { + return 3 + } + + baz() { + return 123 + } +} + +Foo.bar = 'baz' + +module.exports = { + Foo: Foo +}