3
var vows = require("vows"),
4
assert = require("assert");
6
var suite = vows.describe("d3.xml");
11
var cb = this.callback;
12
return d3.xml("examples/data/sample.xml", function(xml) {
16
"invokes the callback with the loaded xml": function(xml) {
17
assert.deepEqual(xml, {_xml: "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<hello>\n <world name=\"Earth\"/>\n</hello>\n"});
19
"does not override the mime type by default": function(xml) {
20
assert.isUndefined(XMLHttpRequest._last._info.mimeType);
24
var cb = this.callback;
25
return d3.xml("examples/data/sample.txt", "application/xml+sample", function(xml) {
29
"observes the optional mime type": function(xml) {
30
assert.equal(XMLHttpRequest._last._info.mimeType, "application/xml+sample");
35
var cb = this.callback;
36
return d3.xml("//does/not/exist.xml", function(xml) {
40
"invokes the callback with null when an error occurs": function(xml) {