Skip to content

Commit

Permalink
Fix tests on Node 14 (#800)
Browse files Browse the repository at this point in the history
* Fix tests on Node 14

Fixes #798

writeFileSync requires a data parameter

* Add Node 14 to CI
  • Loading branch information
RyanZim committed May 14, 2020
1 parent 957e1c3 commit 28173ed
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -7,6 +7,7 @@ node_js:
- 11
- 12
- 13
- 14
env: TEST_SUITE=unit
matrix:
exclude:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -4,7 +4,7 @@ environment:
# node.js
- nodejs_version: "10"
- nodejs_version: "12"

- nodejs_version: "14"
# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
Expand Down
4 changes: 2 additions & 2 deletions lib/ensure/__tests__/create.test.js
Expand Up @@ -46,7 +46,7 @@ describe('fs-extra', () => {
it('should give clear error if node in directory tree is a file', done => {
const existingFile = path.join(TEST_DIR, Math.random() + 'ts-e', Math.random() + '.txt')
fse.mkdirsSync(path.dirname(existingFile))
fs.writeFileSync(existingFile)
fs.writeFileSync(existingFile, '')

const file = path.join(existingFile, Math.random() + '.txt')
fse.createFile(file, err => {
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('fs-extra', () => {
it('should give clear error if node in directory tree is a file', () => {
const existingFile = path.join(TEST_DIR, Math.random() + 'ts-e', Math.random() + '.txt')
fse.mkdirsSync(path.dirname(existingFile))
fs.writeFileSync(existingFile)
fs.writeFileSync(existingFile, '')

const file = path.join(existingFile, Math.random() + '.txt')
try {
Expand Down
2 changes: 1 addition & 1 deletion lib/remove/__tests__/remove.test.js
Expand Up @@ -21,7 +21,7 @@ function buildFixtureDir () {

const subDir = path.join(TEST_DIR, Math.random() + '')
fs.mkdirSync(subDir)
fs.writeFileSync(path.join(subDir, Math.random() + ''))
fs.writeFileSync(path.join(subDir, Math.random() + ''), buf)
return baseDir
}

Expand Down

0 comments on commit 28173ed

Please sign in to comment.