Skip to content

Commit

Permalink
more reliable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Apr 28, 2015
1 parent 955e038 commit 250d328
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/DirectoryWatcher.test.js
Expand Up @@ -78,18 +78,20 @@ describe("DirectoryWatcher", function() {

it("should detect a file change in initial scan with start date", function(done) {
var start = new Date();
testHelper.file("a");
testHelper.tick(function() {
var d = new DirectoryWatcher(fixtures);
var a = d.watch(path.join(fixtures, "a"), start);
a.on("change", function() {
a.close();
done();
testHelper.tick(1000, function() {
testHelper.file("a");
testHelper.tick(1000, function() {
var d = new DirectoryWatcher(fixtures);
var a = d.watch(path.join(fixtures, "a"), start);
a.on("change", function() {
a.close();
done();
});
});
});
});

it("should detect a file change in initial scan without start date", function(done) {
it("should not detect a file change in initial scan without start date", function(done) {
testHelper.file("a");
testHelper.tick(function() {
var d = new DirectoryWatcher(fixtures);
Expand Down

0 comments on commit 250d328

Please sign in to comment.