Sha256: 81471d1e0bf0e7e71e041921bc257a4bd3289e51b86446fbefed1bcd22557cb3

Contents?: true

Size: 747 Bytes

Versions: 31

Compression:

Stored size: 747 Bytes

Contents

require("../env");
require("../../d3");

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);

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
picky-statistics-4.0.2 lib/picky-statistics/application/javascripts/d3/test/core/keys-test.js
picky-statistics-4.0.1 lib/picky-statistics/application/javascripts/d3/test/core/keys-test.js
picky-statistics-4.0.0 lib/picky-statistics/application/javascripts/d3/test/core/keys-test.js
picky-statistics-4.0.0pre6 lib/picky-statistics/application/javascripts/d3/test/core/keys-test.js
picky-statistics-4.0.0pre5 lib/picky-statistics/application/javascripts/d3/test/core/keys-test.js
bum-0.0.17 public/d3/test/core/keys-test.js
bum-0.0.16 public/d3/test/core/keys-test.js
bum-0.0.15 public/d3/test/core/keys-test.js
bum-0.0.14 public/d3/test/core/keys-test.js
bum-0.0.13 public/d3/test/core/keys-test.js
bum-0.0.12 public/d3/test/core/keys-test.js