Add failing spec for remote property with no prototype

This commit is contained in:
Kevin Sawicki 2016-05-27 10:41:10 -07:00
parent ac394ec3ef
commit 7cf6be07a6
2 changed files with 10 additions and 0 deletions

View file

@ -32,6 +32,12 @@ describe('ipc module', function () {
assert.equal(a.id, 1127)
})
it('should work when object has no prototype', function () {
var a = remote.require(path.join(fixtures, 'module', 'no-prototype.js'))
assert.deepEqual(a.foo, {})
assert.equal(a.bar, 1234)
})
it('should search module from the user app', function () {
comparePaths(path.normalize(remote.process.mainModule.filename), path.resolve(__dirname, 'static', 'main.js'))
comparePaths(path.normalize(remote.process.mainModule.paths[0]), path.resolve(__dirname, 'static', 'node_modules'))

4
spec/fixtures/module/no-prototype.js vendored Normal file
View file

@ -0,0 +1,4 @@
module.exports = {
foo: Object.create(null),
bar: 1234
}