Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix tests to accommodate d3 v3 changes

  • Loading branch information...
commit 4818e1f2a3222cefbe9980f5db7667d33e8b93f9 1 parent c9435ae
@dchester dchester authored
Showing with 24 additions and 24 deletions.
  1. +1 −1  package.json
  2. +18 −23 tests/Rickshaw.Graph.js
  3. +5 −0 vendor/d3.v3.js
View
2  package.json
@@ -2,7 +2,7 @@
"name": "rickshaw",
"version": "1.4.3",
"dependencies": {
- "d3": "~2.10.1"
+ "d3": "~3.3.6"
},
"keywords": [
"d3",
View
41 tests/Rickshaw.Graph.js
@@ -1,14 +1,26 @@
var fs = require('fs');
+var Rickshaw;
-exports.svg = function(test) {
+exports.setUp = function(callback) {
- var jsdom = require("jsdom").jsdom;
- global.document = jsdom("<html><head></head><body></body></html>");
- global.window = global.document.createWindow();
+ Rickshaw = require('../rickshaw');
+
+ global.document = d3.select('html')[0][0].parentNode;
+ global.window = document.defaultView;
- var Rickshaw = require('../rickshaw');
new Rickshaw.Compat.ClassList();
+ callback();
+};
+
+exports.tearDown = function(callback) {
+
+ delete require.cache.d3;
+ callback();
+};
+
+exports.svg = function(test) {
+
var el = document.createElement("div");
var graph = new Rickshaw.Graph({
@@ -42,13 +54,6 @@ exports.svg = function(test) {
exports.validate = function(test) {
- var jsdom = require("jsdom").jsdom;
- global.document = jsdom("<html><head></head><body></body></html>");
- global.window = global.document.createWindow();
-
- var Rickshaw = require('../rickshaw');
- new Rickshaw.Compat.ClassList();
-
var el = document.createElement("div");
test.throws( function() {
@@ -76,13 +81,6 @@ exports.validate = function(test) {
exports.inconsistent = function(test) {
- var jsdom = require("jsdom").jsdom;
- global.document = jsdom("<html><head></head><body></body></html>");
- global.window = global.document.createWindow();
-
- var Rickshaw = require('../rickshaw');
- new Rickshaw.Compat.ClassList();
-
var el = document.createElement("div");
var series = [
@@ -150,10 +148,6 @@ exports.inconsistent = function(test) {
exports.rendererAutodiscover = function(test) {
- var jsdom = require("jsdom").jsdom;
- global.document = jsdom("<html><head></head><body></body></html>");
- global.window = global.document.createWindow();
-
var Rickshaw = require('../rickshaw');
new Rickshaw.Compat.ClassList();
@@ -203,3 +197,4 @@ exports.rendererAutodiscover = function(test) {
test.done();
};
+
View
5 vendor/d3.v3.js
5 additions, 0 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.