Sha256: edbce5a430af54a3bf70467419ef72cefa3d44d0ce4c9e8a7069d46e91af74a0

Contents?: true

Size: 828 Bytes

Versions: 4

Compression:

Stored size: 828 Bytes

Contents

var vows = require("vows"),
    load = require("../load"),
    assert = require("../assert");

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

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

suite.export(module);

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
stripchart-0.0.3 lib/stripchart/public/components/d3/test/arrays/values-test.js
stripmem-0.0.3 lib/stripmem/public/components/d3/test/arrays/values-test.js
stripmem-0.0.2 lib/stripmem/public/components/d3/test/arrays/values-test.js
stripmem-0.0.1 lib/stripmem/public/components/d3/test/arrays/values-test.js