Skip to content

Commit

Permalink
Merge pull request #25 from kevinbeaty/mz/fs
Browse files Browse the repository at this point in the history
Update list of mz/fs functions to proxy, add test for mkdtemp()
  • Loading branch information
kevinbeaty authored Mar 26, 2017
2 parents 3f53728 + 88c9a34 commit c37c1e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,24 @@ var mzKeys = [
'unlink',
'rmdir',
'mkdir',
'mkdtemp',
'readdir',
'close',
'open',
'utimes',
'futimes',
'fsync',
'fdatasync',
'write',
'read',
'readFile',
'writeFile',
'appendFile',
'access',
'truncate',
'exists'
]

mzKeys.forEach(function(key){
exports[key] = mzfs[key]
})
10 changes: 9 additions & 1 deletion test/mz.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Tests from mz. License MIT
// Tests from mz. License MIT
// https://github.com/normalize/mz
var assert = require('assert')

Expand All @@ -12,6 +12,14 @@ describe('fs', function () {
}).catch(done)
})

it('.mkdtemp()', function (done) {
if (!require('fs').mkdtemp) this.skip()
fs.mkdtemp('/tmp/').then(function (folder) {
fs.rmdirSync(folder)
done()
}).catch(done)
})

it('.statSync()', function () {
var stats = fs.statSync(__filename)
assert.equal(typeof stats.size, 'number')
Expand Down

0 comments on commit c37c1e1

Please sign in to comment.