-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Description
The following tests should not fail:
it('should clone a getter', () => {
const input = {
a: 2,
get foo() {
return this.a * 2
}
}
let clone = func(input)
assert.ok(clone.foo === 4)
assert.ok(
typeof Object.getOwnPropertyDescriptor(clone, 'foo').get === 'function'
)
})
it('should clone a setter', () => {
const input = {
set foo(val) {
this.a = val
}
}
let clone = func(input)
clone.foo('bar')
assert.ok(clone.a === 'bar')
assert.ok(input.a === undefined)
assert.ok(
typeof Object.getOwnPropertyDescriptor(clone, 'foo').set === 'function'
)
})Metadata
Metadata
Assignees
Labels
No labels