Skip to content

Commit

Permalink
Test: Allow time for file to be written
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFrost committed Jun 20, 2014
1 parent cfe01e7 commit 1e54fe6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/targets/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ describe("File Target", function() {
done();
});
});
it("should write the supplied message to a file", function() {
it("should write the supplied message to a file", function(done) {
file({file: tmpFile}, 'debug', new Date(), 'foo');
fs.readFile(tmpFile, {encoding:'utf8'}, function(err, data) {
should.not.exist(err);
should.exist(data);
data.should.eql("foo\n");
});
setTimeout(function() {
fs.readFile(tmpFile, {encoding:'utf8'}, function(err, data) {
should.not.exist(err);
should.exist(data);
data.should.eql("foo\n");
done();
});
}, 500);
});
});

0 comments on commit 1e54fe6

Please sign in to comment.