oolong
Version:
Utilities for objects. Simple, tasteful and plentiful. Supports inherited properties.
14 lines (11 loc) • 356 B
JavaScript
var O = require("../..")
describe("Oolong.ownKeys", function() {
it("must return all enumerable keys of an object", function() {
O.ownKeys({a: 1, b: 2}).must.eql(["a", "b"])
})
it("must not return inherited enumerable keys of an object", function() {
var obj = Object.create({a: 1})
obj.b = 2
O.ownKeys(obj).must.eql(["b"])
})
})