Browse Source

lib/index: bugfix fs contants. Closes #120

ci/travis-osximage
JP Richardson 10 years ago
parent
commit
931d409429
  1. 12
      lib/index.js
  2. 8
      test/fs-integration.test.js

12
lib/index.js

@ -2,16 +2,14 @@ var jsonFile = require('jsonfile')
var json = require('./json')
var fse = {}
var fs = require('graceful-fs')
var gfs = require('graceful-fs')
// attach fs methods to fse
Object.keys(fs).forEach(function (key) {
var func = fs[key]
if (typeof func === 'function') {
fse[key] = func
}
Object.keys(gfs).forEach(function (key) {
fse[key] = gfs[key]
})
fs = fse
var fs = fse
var copy = require('./copy')
fs.copy = copy.copy

8
test/fs-integration.test.js

@ -1,6 +1,7 @@
var assert = require('assert')
var path = require('path')
var os = require('os')
var fs = require('fs')
var fse = require('../')
/* global afterEach, beforeEach, describe, it */
@ -23,4 +24,11 @@ describe('native fs', function () {
var data = fse.readFileSync(file, 'utf8')
assert.equal(data, 'hello')
})
it('should have native fs constants', function () {
// Node.js v0.12 / IO.js
if ('F_OK' in fs) {
assert.equal(fse.F_OK, fs.F_OK)
}
})
})

Loading…
Cancel
Save