-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeys-test.js
More file actions
30 lines (26 loc) · 726 Bytes
/
Copy pathkeys-test.js
File metadata and controls
30 lines (26 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require("../env");
var vows = require("vows"),
assert = require("assert");
var suite = vows.describe("d3.keys");
suite.addBatch({
"keys": {
topic: function() {
return d3.keys;
},
"enumerates every defined key": function(keys) {
assert.deepEqual(keys({a: 1, b: 1}), ["a", "b"]);
},
"includes keys defined on prototypes": function(keys) {
function abc() {
this.a = 1;
this.b = 2;
}
abc.prototype.c = 3;
assert.deepEqual(keys(new abc()), ["a", "b", "c"]);
},
"includes keys with null or undefined values": function(keys) {
assert.deepEqual(keys({a: undefined, b: null, c: NaN}), ["a", "b", "c"]);
}
}
});
suite.export(module);