Skip to content

Commit

Permalink
test/remove: moved tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jprichardson committed Apr 27, 2015
1 parent 7a082e3 commit 2e9ac77
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
10 changes: 0 additions & 10 deletions test/remove/remote.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ describe('remove', function () {
if (fs.existsSync(TEST_DIR)) fse.removeSync(TEST_DIR)
})

describe('+ removeSync()', function () {
it('should delete a file synchronously', function () {
var file = path.join(TEST_DIR, 'file')
fs.writeFileSync(file, 'hello')
assert(fs.existsSync(file))
fse.removeSync(file)
assert(!fs.existsSync(file))
})
})

describe('+ remove()', function () {
it('should delete an empty directory', function (done) {
assert(fs.existsSync(TEST_DIR))
Expand Down
27 changes: 26 additions & 1 deletion test/remove/remove-sync-file.test.js
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
// todo
var assert = require('assert')
var fs = require('fs')
var os = require('os')
var path = require('path')
var fse = require(process.cwd())

/* global beforeEach, describe, it */

describe('remove/sync', function () {
var TEST_DIR

beforeEach(function (done) {
TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'remove-sync')
fse.emptyDir(TEST_DIR, done)
})

describe('+ removeSync()', function () {
it('should delete a file synchronously', function () {
var file = path.join(TEST_DIR, 'file')
fs.writeFileSync(file, 'hello')
assert(fs.existsSync(file))
fse.removeSync(file)
assert(!fs.existsSync(file))
})
})
})

0 comments on commit 2e9ac77

Please sign in to comment.