-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #841
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict' | ||
|
||
const fse = require('../..') | ||
const os = require('os') | ||
const path = require('path') | ||
const assert = require('assert') | ||
const atLeastNode = require('at-least-node') | ||
|
||
/* eslint-env mocha */ | ||
|
||
// Used for tests on Node 14.14.0+ only | ||
const describeNode14 = atLeastNode('14.14.0') ? describe : describe.skip | ||
|
||
describeNode14('fs.rm', () => { | ||
let TEST_FILE | ||
|
||
beforeEach(done => { | ||
TEST_FILE = path.join(os.tmpdir(), 'fs-extra', 'fs-rm') | ||
fse.remove(TEST_FILE, done) | ||
}) | ||
|
||
afterEach(done => fse.remove(TEST_FILE, done)) | ||
|
||
it('supports promises', () => { | ||
fse.writeFileSync(TEST_FILE, 'hello') | ||
return fse.rm(TEST_FILE).then(() => { | ||
assert(!fse.pathExistsSync(TEST_FILE)) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters