Skip to content

Commit

Permalink
fix "complexity", nah
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Oct 11, 2015
1 parent c06a14e commit 85051e0
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@ test('should accept sync function returning failing observable', function (done)
})
})

test('should accept sync (fs.readFileSync) function and handle buffer', function (done) {
alwaysDone(fs.readFileSync, 'package.json')
.then(function (buf) {
test.strictEqual(isBuffer(buf), true)
done()
}, done)
})

test('should accept sync function which returns stream and handle completion', function (done) {
alwaysDone(function () {
return fs.createReadStream('package.json')
Expand All @@ -139,6 +131,22 @@ test('should accept sync function which returns failing stream completion', func
})
})

test('should accept sync (fs.readFileSync) function and handle buffer', function (done) {
alwaysDone(fs.readFileSync, 'package.json')
.then(function (buf) {
test.strictEqual(isBuffer(buf), true)
done()
}, done)
})

test('should accept asynchronous function and get buffer', function (done) {
var read = fs.readFile
alwaysDone(read, 'package.json').then(function (res) {
test.strictEqual(isBuffer(res), true)
done()
}, done)
})

test('should accept async (callback) functions and handle utf8 result', function (done) {
alwaysDone(fs.readFile, 'package.json', 'utf8')
.then(JSON.parse)
Expand All @@ -147,11 +155,3 @@ test('should accept async (callback) functions and handle utf8 result', function
done()
}, done)
})

test('should accept async (fs.readFile) functions and handle buffer result', function (done) {
alwaysDone(fs.readFile, 'package.json')
.then(function (buf) {
test.strictEqual(isBuffer(buf), true)
done()
}, done)
})

0 comments on commit 85051e0

Please sign in to comment.