Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
fix existsSync
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed Jul 7, 2012
1 parent 876d969 commit 24b7db7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/download.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 24b7db7

Please sign in to comment.