From 24b7db756981b2b83222df0df428d1e727433716 Mon Sep 17 00:00:00 2001 From: Roly Fentanes Date: Sat, 7 Jul 2012 06:55:01 -0700 Subject: [PATCH] fix existsSync --- test/download.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/download.js b/test/download.js index 5c605f5..d58adfc 100644 --- a/test/download.js +++ b/test/download.js @@ -1,9 +1,11 @@ -var vows = require('vows') - , ytdl = require('..') - , fs = require('fs') - , path = require('path') - , assert = require('assert') - , video = 'http://www.youtube.com/watch?v=90AiXO1pAiA' +var vows = require('vows') + , ytdl = require('..') + , fs = require('fs') + , path = require('path') + , existsSync = fs.existsSync || path.existsSync + , assert = require('assert') + , video = 'http://www.youtube.com/watch?v=90AiXO1pAiA' + ; vows.describe('download').addBatch({ @@ -36,7 +38,7 @@ vows.describe('download').addBatch({ 'file was downloaded': function(err, data) { // check existance var filepath = path.join(__dirname, data.filename); - assert.isTrue(fs.existsSync(filepath)); + assert.isTrue(existsSync(filepath)); // delete file after each test fs.unlinkSync(filepath);