mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add failing spec for remote function with properties
This commit is contained in:
@@ -52,6 +52,17 @@ describe('ipc module', function () {
|
||||
comparePaths(path.normalize(remote.process.mainModule.paths[0]), path.resolve(__dirname, 'static', 'node_modules'))
|
||||
})
|
||||
|
||||
it('should work with function properties', function () {
|
||||
var a = remote.require(path.join(fixtures, 'module', 'export-function-with-properties.js'))
|
||||
assert.equal(typeof a, 'function')
|
||||
assert.equal(a.bar, 'baz')
|
||||
|
||||
a = remote.require(path.join(fixtures, 'module', 'function-with-properties.js'))
|
||||
assert.equal(typeof a, 'object')
|
||||
assert.equal(typeof a.foo, 'function')
|
||||
assert.equal(a.foo.bar, 'baz')
|
||||
})
|
||||
|
||||
it('handles circular references in arrays and objects', function () {
|
||||
var a = remote.require(path.join(fixtures, 'module', 'circular.js'))
|
||||
|
||||
|
||||
4
spec/fixtures/module/export-function-with-properties.js
vendored
Normal file
4
spec/fixtures/module/export-function-with-properties.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
function foo() {}
|
||||
foo.bar = 'baz'
|
||||
|
||||
module.exports = foo
|
||||
6
spec/fixtures/module/function-with-properties.js
vendored
Normal file
6
spec/fixtures/module/function-with-properties.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
function foo() {}
|
||||
foo.bar = 'baz'
|
||||
|
||||
module.exports = {
|
||||
foo: foo
|
||||
}
|
||||
Reference in New Issue
Block a user