-
Notifications
You must be signed in to change notification settings - Fork 774
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: Drop old Node support (#751)
* BREAKING: Drop old Node support, require v10+ Update CI configs * Remove references and test fencing for old Node versions * Use object spread properties * Use octal literal notation * Use optional catch bindings
- Loading branch information
Showing
36 changed files
with
120 additions
and
189 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 |
---|---|---|
|
@@ -3,12 +3,10 @@ os: | |
- linux | ||
- osx | ||
node_js: | ||
- 6 | ||
- 8 | ||
- 9 | ||
- 10 | ||
- 11 | ||
- 12 | ||
- 13 | ||
env: TEST_SUITE=unit | ||
matrix: | ||
exclude: | ||
|
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,33 +1,29 @@ | ||
'use strict' | ||
|
||
const os = require('os') | ||
const fs = require('fs') | ||
const fse = require('../..') | ||
const path = require('path') | ||
const assert = require('assert') | ||
|
||
/* eslint-env mocha */ | ||
|
||
// Only availible in Node 8.5+ | ||
if (typeof fs.copyFile === 'function') { | ||
describe('fs.copyFile', () => { | ||
let TEST_DIR | ||
describe('fs.copyFile', () => { | ||
let TEST_DIR | ||
|
||
beforeEach(done => { | ||
TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'fs-copyfile') | ||
fse.emptyDir(TEST_DIR, done) | ||
}) | ||
beforeEach(done => { | ||
TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'fs-copyfile') | ||
fse.emptyDir(TEST_DIR, done) | ||
}) | ||
|
||
afterEach(done => fse.remove(TEST_DIR, done)) | ||
afterEach(done => fse.remove(TEST_DIR, done)) | ||
|
||
it('supports promises', () => { | ||
const src = path.join(TEST_DIR, 'init.txt') | ||
const dest = path.join(TEST_DIR, 'copy.txt') | ||
fse.writeFileSync(src, 'hello') | ||
return fse.copyFile(src, dest).then(() => { | ||
const data = fse.readFileSync(dest, 'utf8') | ||
assert.strictEqual(data, 'hello') | ||
}) | ||
it('supports promises', () => { | ||
const src = path.join(TEST_DIR, 'init.txt') | ||
const dest = path.join(TEST_DIR, 'copy.txt') | ||
fse.writeFileSync(src, 'hello') | ||
return fse.copyFile(src, dest).then(() => { | ||
const data = fse.readFileSync(dest, 'utf8') | ||
assert.strictEqual(data, 'hello') | ||
}) | ||
}) | ||
} | ||
}) |
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
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
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 |
---|---|---|
@@ -1,33 +1,29 @@ | ||
'use strict' | ||
|
||
const fs = require('fs') | ||
const fse = require('../..') | ||
const assert = require('assert') | ||
|
||
/* eslint-env mocha */ | ||
|
||
// fs.realpath.native only available in Node v9.2+ | ||
if (typeof fs.realpath.native === 'function') { | ||
describe('realpath.native', () => { | ||
it('works with callbacks', () => { | ||
fse.realpath.native(__dirname, (err, path) => { | ||
assert.ifError(err) | ||
assert.strictEqual(path, __dirname) | ||
}) | ||
describe('realpath.native', () => { | ||
it('works with callbacks', () => { | ||
fse.realpath.native(__dirname, (err, path) => { | ||
assert.ifError(err) | ||
assert.strictEqual(path, __dirname) | ||
}) | ||
}) | ||
|
||
it('works with promises', (done) => { | ||
fse.realpath.native(__dirname) | ||
.then(path => { | ||
assert.strictEqual(path, __dirname) | ||
done() | ||
}) | ||
.catch(done) | ||
}) | ||
it('works with promises', (done) => { | ||
fse.realpath.native(__dirname) | ||
.then(path => { | ||
assert.strictEqual(path, __dirname) | ||
done() | ||
}) | ||
.catch(done) | ||
}) | ||
|
||
it('works with sync version', () => { | ||
const path = fse.realpathSync.native(__dirname) | ||
assert.strictEqual(path, __dirname) | ||
}) | ||
it('works with sync version', () => { | ||
const path = fse.realpathSync.native(__dirname) | ||
assert.strictEqual(path, __dirname) | ||
}) | ||
} | ||
}) |
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
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
Oops, something went wrong.