en.javascript.info/1-js/5-data-structures/4-object2/5-count-properties/_js.view/test.js
Ilya Kantor 057783d216 work
2016-07-21 17:05:55 +03:00

13 lines
No EOL
338 B
JavaScript

describe("count", function() {
it("counts the number of properties", function() {
assert.equal( count({a: 1, b: 2}), 2 );
});
it("returns 0 for an empty object", function() {
assert.equal( count({}), 0 );
});
it("ignores symbolic properties", function() {
assert.equal( count({ [Symbol('id')]: 1 }), 0 );
});
});