Add anonymous class to exports and assert it

This commit is contained in:
Kevin Sawicki 2016-07-06 13:11:25 -07:00
parent a9b43a0fc9
commit 56739e10e3
2 changed files with 3 additions and 1 deletions

View file

@ -35,8 +35,9 @@ describe('ipc module', function () {
assert.equal(a.foo.bar, 'baz')
assert.equal(a.foo.baz, false)
assert.equal(a.bar, 1234)
assert.equal(a.anonymous.constructor.name, '')
assert.equal(a.getConstructorName(Object.create(null)), '')
assert.equal(a.getConstructorName(new (class {})), '')
assert.equal(a.getConstructorName(new class {}), '')
})
it('should search module from the user app', function () {

View file

@ -4,6 +4,7 @@ foo.baz = false
module.exports = {
foo: foo,
bar: 1234,
anonymous: new class {},
getConstructorName: function (value) {
return value.constructor.name
}