Allow spec to be run multiple times in same runner

This commit is contained in:
Kevin Sawicki 2016-09-14 11:16:44 -07:00
parent 359ab2f9b3
commit f792c720f4
2 changed files with 12 additions and 10 deletions

View file

@ -70,7 +70,7 @@ describe('ipc module', function () {
assert.ok(Object.keys(a.foo).includes('nested')) assert.ok(Object.keys(a.foo).includes('nested'))
assert.ok(Object.keys(a.foo).includes('method1')) assert.ok(Object.keys(a.foo).includes('method1'))
a = remote.require(path.join(fixtures, 'module', 'function-with-missing-properties.js')) a = remote.require(path.join(fixtures, 'module', 'function-with-missing-properties.js')).setup()
assert.equal(a.bar(), true) assert.equal(a.bar(), true)
assert.equal(typeof a.bar.baz, 'function') assert.equal(typeof a.bar.baz, 'function')
}) })

View file

@ -1,3 +1,4 @@
exports.setup = function () {
const foo = {} const foo = {}
foo.bar = function () { foo.bar = function () {
@ -8,4 +9,5 @@ foo.bar.baz = function () {
return 3 return 3
} }
module.exports = foo return foo
}