diff --git a/test/read.test.js b/test/read.test.js index 233e1ef..2d659e8 100644 --- a/test/read.test.js +++ b/test/read.test.js @@ -1,10 +1,10 @@ var fs = require('../lib') , testutil = require('testutil') - , path = require('path'); + , path = require('path') var terst = require('terst') -var DIR = ''; +var DIR = '' describe('fs-extra', function() { beforeEach(function() { @@ -12,7 +12,7 @@ describe('fs-extra', function() { }) afterEach(function(done) { - fs.remove(DIR, done); + fs.remove(DIR, done) }) describe('+ readJSON', function() { @@ -20,51 +20,30 @@ describe('fs-extra', function() { var obj1 = { firstName: 'JP', lastName: 'Richardson' - }; - var file = path.join(DIR, 'file.json'); + } + var file = path.join(DIR, 'file.json') - fs.writeFileSync(file, JSON.stringify(obj1)); + fs.writeFileSync(file, JSON.stringify(obj1)) fs.readJSON(file, function(err, obj2) { - F (err != null); - T (obj1.firstName === obj2.firstName); - T (obj1.lastName === obj2.lastName); + F (err != null) + T (obj1.firstName === obj2.firstName) + T (obj1.lastName === obj2.lastName) - done(); + done() }) }) it('should error if it cant parse the json', function(done) { - var file = path.join(DIR, 'file2.json'); - fs.writeFileSync(file, '%asdfasdff444'); + var file = path.join(DIR, 'file2.json') + fs.writeFileSync(file, '%asdfasdff444') fs.readJSON(file, function(err, obj) { - T (err != null); - F (obj); - done(); - }) - }) - }) - - /*(describe('+ readTextFile', function() { - it('should read the text file', function(done) { - var file = path.join(DIR, 'readtext.txt') - fs.writeFileSync(file, "hello") - fs.readTextFile(file, function(err, data) { - if (err) return done(err) - EQ (data, 'hello') + T (err != null) + F (obj) done() }) }) }) - - describe('+ readTextFileSync', function() { - it('should read the text file', function() { - var file = path.join(DIR, 'readtext.txt') - fs.writeFileSync(file, "hello") - var data = fs.readTextFileSync(file) - EQ (data, 'hello') - }) - })*/ })