Skip to content

Commit 1be121a

Browse files
committed
Unplug env-js' timer module.
This was breaking setTimeout and setInterval in Node, since I've already unplugged env-js' event loop. With that out of the way, we can write tests for transitions!
1 parent eaed6b8 commit 1be121a

6 files changed

Lines changed: 2321 additions & 2396 deletions

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ d3.geom.js: \
136136
tests: \
137137
tests/test-append.test \
138138
tests/test-attr.test \
139-
tests/test-format.test
139+
tests/test-format.test \
140+
tests/test-transition.test
140141

141142
%.min.js: %.js Makefile
142143
@rm -f $@

lib/env-js/envjs/parser.js

Lines changed: 2295 additions & 2299 deletions
Large diffs are not rendered by default.

lib/env-js/envjs/platform/core.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,6 @@ Envjs.emit = function(event /*, arg1, arg2, etc*/ ){
980980
eventQueue.push({event:event, args:arguments});
981981
};
982982

983-
setTimeout = require('./../timer').setTimeout;
984-
985983
var $warming = 10;
986984

987985
Envjs.tick = function(){

lib/env-js/envjs/timer.js

Lines changed: 0 additions & 94 deletions
This file was deleted.

tests/test-transition.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require("./../lib/env-js/envjs/node");
2+
require("./../lib/sizzle/sizzle");
3+
require("./../d3");
4+
5+
var body = d3.select("body")
6+
.style("background-color", "white");
7+
8+
console.log("transition start:");
9+
console.log(" ", body.style("background-color"));
10+
console.log("");
11+
12+
body.transition()
13+
.style("background-color", "red")
14+
.each("end", function() {
15+
console.log("transition end:");
16+
console.log(" ", body.style("background-color"));
17+
console.log("");
18+
});

tests/test-transition.out

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
transition start:
2+
white
3+
4+
transition end:
5+
rgb(255,0,0)
6+

0 commit comments

Comments
 (0)