| 1 |
function pushElement(e) { |
| 2 |
return function (c) { c.elements.push(e); return c }; |
| 3 |
} |
| 4 |
|
| 5 |
var value = {}; |
| 6 |
|
| 7 |
@pushElement({ |
| 8 |
kind: "field", |
| 9 |
placement: "static", |
| 10 |
key: "foo", |
| 11 |
descriptor: { |
| 12 |
enumerable: true, |
| 13 |
configurable: true, |
| 14 |
writable: true, |
| 15 |
}, |
| 16 |
initializer() { |
| 17 |
return value; |
| 18 |
} |
| 19 |
}) |
| 20 |
class A {} |
| 21 |
|
| 22 |
expect(A.prototype).not.toHaveProperty("foo"); |
| 23 |
expect(new A()).not.toHaveProperty("foo"); |
| 24 |
|
| 25 |
expect(Object.getOwnPropertyDescriptor(A, "foo")).toEqual({ |
| 26 |
enumerable: true, |
| 27 |
configurable: true, |
| 28 |
writable: true, |
| 29 |
value: value, |
| 30 |
}); |