Skip to content

Commit

Permalink
tests for exists fns
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Jan 10, 2016
1 parent 03b05bd commit a17643f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,3 +584,45 @@ describe('deepExtend()', function () {
})
})
})

describe('existsSync()', function () {
var dir = path.join(__dirname, 'data', 'csv')
describe('exists', function () {
it('should be equal', function () {
var exists = io.existsSync(path.join(dir, 'basic.csv'))
assert.equal(exists, true)
})
})
describe('does not exist', function () {
it('should be equal', function () {
var exists = io.existsSync(path.join(dir, 'doesnt-exist.csv'))
assert.equal(exists, false)
})
})
})

describe('exists()', function () {
var dir = path.join(__dirname, 'data', 'csv')
describe('exists', function () {
it('should be equal', function (done) {
io.exists(path.join(dir, 'basic.csv'), function (err, exists) {
if (err) {
console.log(err)
}
assert.equal(exists, true)
done()
})
})
})
describe('does not exist', function () {
it('should be equal', function (done) {
io.exists(path.join(dir, 'doesnt-exist.csv'), function (err, exists) {
if (err) {
console.log(err)
}
assert.equal(exists, false)
done()
})
})
})
})

0 comments on commit a17643f

Please sign in to comment.