Sha256: 7f3feccfe05e0a3ca871b943b7bffc9cde06332e4aee1d6d2c2a128b61e90c14
Contents?: true
Size: 947 Bytes
Versions: 31
Compression:
Stored size: 947 Bytes
Contents
require("../env"); require("../../d3"); require("../../d3.csv"); var vows = require("vows"), assert = require("assert"); var suite = vows.describe("d3.csv"); suite.addBatch({ "csv": { topic: function() { var cb = this.callback; return d3.csv("examples/data/sample.csv", function(csv) { cb(null, csv); }); }, "invokes the callback with the parsed CSV": function(csv) { assert.deepEqual(csv, [{"Hello":42,"World":"\"fish\""}]); }, "overrides the mime type to text/csv": function(csv) { assert.equal(XMLHttpRequest._last._info.mimeType, "text/csv"); }, "": { topic: function() { var cb = this.callback; return d3.csv("//does/not/exist.csv", function(csv) { cb(null, csv); }); }, "invokes the callback with null when an error occurs": function(csv) { assert.isNull(csv); } } } }); suite.export(module);
Version data entries
31 entries across 31 versions & 2 rubygems