зеркало из https://github.com/electron/electron.git
Add failing spec for remote function with properties
This commit is contained in:
Родитель
0955c2fd4d
Коммит
5cc61089d9
|
@ -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'))
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
function foo() {}
|
||||
foo.bar = 'baz'
|
||||
|
||||
module.exports = foo
|
|
@ -0,0 +1,6 @@
|
|||
function foo() {}
|
||||
foo.bar = 'baz'
|
||||
|
||||
module.exports = {
|
||||
foo: foo
|
||||
}
|
Загрузка…
Ссылка в новой задаче