Sha256: 749707c004cb36ac8e5ac1655900e9853f55d4016ac9d9d2ae2459b947408d3f

Contents?: true

Size: 1.06 KB

Versions: 31

Compression:

Stored size: 1.06 KB

Contents

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

var vows = require("vows"),
    assert = require("assert");

var suite = vows.describe("d3.entries");

suite.addBatch({
  "entries": {
    topic: function() {
      return d3.entries;
    },
    "enumerates every entry": function(entries) {
      assert.deepEqual(entries({a: 1, b: 2}), [
        {key: "a", value: 1},
        {key: "b", value: 2}
      ]);
    },
    "includes entries defined on prototypes": function(entries) {
      function abc() {
        this.a = 1;
        this.b = 2;
      }
      abc.prototype.c = 3;
      assert.deepEqual(entries(new abc()), [
        {key: "a", value: 1},
        {key: "b", value: 2},
        {key: "c", value: 3}
      ]);
    },
    "includes null or undefined values": function(entries) {
      var v = entries({a: undefined, b: null, c: NaN});
      assert.equal(v.length, 3);
      assert.deepEqual(v[0], {key: "a", value: undefined});
      assert.deepEqual(v[1], {key: "b", value: null});
      assert.equal(v[2].key, "c");
      assert.isNaN(v[2].value);
    }
  }
});

suite.export(module);

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
picky-statistics-4.5.0 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.4.2 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.4.1 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.4.0 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.3.2 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.3.1 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.3.0 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.2.4 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.2.3 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.2.2 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.2.1 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.2.0 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.1.0 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.0.9 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.0.8 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.0.7 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.0.6 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.0.5 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.0.4 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js
picky-statistics-4.0.3 lib/picky-statistics/application/javascripts/d3/test/core/entries-test.js