From 5383dff2bd468c4783b783d56e2441823154599f Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Sun, 4 Oct 2020 13:23:04 +0200 Subject: [PATCH 1/2] Reformat --- test/fs-blob-storage-errors.ts | 16 ++++------------ test/fs-blob-storage-exclusive-errors.ts | 8 ++------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/test/fs-blob-storage-errors.ts b/test/fs-blob-storage-errors.ts index b606ebb..d8b7b24 100644 --- a/test/fs-blob-storage-errors.ts +++ b/test/fs-blob-storage-errors.ts @@ -39,9 +39,7 @@ Feature("Test FsBlobStorage errors", () => { }) Then("error is caught", () => { - expect(error) - .to.be.an("error") - .and.have.property("code", "ENOENT") + expect(error).to.be.an("error").and.have.property("code", "ENOENT") }) }) @@ -68,9 +66,7 @@ Feature("Test FsBlobStorage errors", () => { }) Then("error is caught", () => { - expect(error) - .to.be.an("error") - .and.have.property("code", "ENOENT") + expect(error).to.be.an("error").and.have.property("code", "ENOENT") }) }) @@ -97,9 +93,7 @@ Feature("Test FsBlobStorage errors", () => { }) Then("error is caught", () => { - expect(error) - .to.be.an("error") - .and.have.property("code", "ENOENT") + expect(error).to.be.an("error").and.have.property("code", "ENOENT") }) }) @@ -126,9 +120,7 @@ Feature("Test FsBlobStorage errors", () => { }) Then("error is caught", () => { - expect(error) - .to.be.an("error") - .and.have.property("code", "ENOENT") + expect(error).to.be.an("error").and.have.property("code", "ENOENT") }) }) }) diff --git a/test/fs-blob-storage-exclusive-errors.ts b/test/fs-blob-storage-exclusive-errors.ts index f46d268..8c637ec 100644 --- a/test/fs-blob-storage-exclusive-errors.ts +++ b/test/fs-blob-storage-exclusive-errors.ts @@ -43,9 +43,7 @@ Feature("Test FsBlobStorage errors for exclusive option", () => { }) Then("error is caught", () => { - expect(error) - .to.be.an("error") - .and.have.property("code", "EEXIST") + expect(error).to.be.an("error").and.have.property("code", "EEXIST") }) }) @@ -76,9 +74,7 @@ Feature("Test FsBlobStorage errors for exclusive option", () => { }) Then("error is caught", () => { - expect(error) - .to.be.an("error") - .and.have.property("code", "EEXIST") + expect(error).to.be.an("error").and.have.property("code", "EEXIST") }) }) }) From 0bcf6b0e44c57598f3e1da7fa101f2c13807f9d6 Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Sun, 4 Oct 2020 13:23:51 +0200 Subject: [PATCH 2/2] Correct types for @types/node@12.12.62 --- CHANGELOG.md | 4 ++++ package.json | 2 +- test/lib/mock-fs.ts | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf1c21..5439064 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v3.0.0 YYYY-mm-dd + +- Correct typings for updates @types/node. + ## v2.1.4 2019-10-08 - Bugfix `mocha-steps` wrapper for testing. diff --git a/package.json b/package.json index 3c13651..870c46e 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@types/chai": "^4.2.3", "@types/dirty-chai": "^2.0.2", "@types/mocha": "^5.2.7", - "@types/node": "^12.7.11", + "@types/node": "^12.12.62", "chai": "^4.2.0", "changelog-parser": "^2.8.0", "coveralls": "^3.0.6", diff --git a/test/lib/mock-fs.ts b/test/lib/mock-fs.ts index a3c3524..7283265 100644 --- a/test/lib/mock-fs.ts +++ b/test/lib/mock-fs.ts @@ -146,7 +146,11 @@ export function mkdir( callback = options } else if (typeof options === "object") { const makeDirectoryOptions = options as fs.MakeDirectoryOptions - mode = makeDirectoryOptions.mode || 0o777 + if (typeof makeDirectoryOptions.mode === "number") { + mode = makeDirectoryOptions.mode || 0o777 + } else { + mode = parseInt(makeDirectoryOptions.mode!, 8) || 0o777 + } recursive = makeDirectoryOptions.recursive || false } if (recursive) {