From 22caed74a51510f9a4c69d3fac918caab488173c Mon Sep 17 00:00:00 2001 From: Laurence Dougal Myers Date: Sat, 3 Jul 2021 15:38:34 +1000 Subject: [PATCH 1/2] chore(.gitignore): ignore '.idea' directory, created by the IDE IntelliJ IDEA. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a63a7fa95..0f1860025 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .cache +.idea .nyc_output .vscode coverage From faa2ab540c9b609da67a57065703eb5c0b5df4c7 Mon Sep 17 00:00:00 2001 From: Laurence Dougal Myers Date: Sat, 3 Jul 2021 15:43:33 +1000 Subject: [PATCH 2/2] fix(types): fix issue #2174: DataMatcherArray now allows ReadonlyArrays (including tuples). --- types/index.d.ts | 2 +- types/tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 9a81a905a..b0c26bd17 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -52,7 +52,7 @@ declare namespace nock { | RegExp | DataMatcherArray | DataMatcherMap - interface DataMatcherArray extends Array {} + interface DataMatcherArray extends ReadonlyArray {} interface DataMatcherMap { [key: string]: DataMatcher } diff --git a/types/tests.ts b/types/tests.ts index cfc870137..f241e0982 100644 --- a/types/tests.ts +++ b/types/tests.ts @@ -40,7 +40,7 @@ inst = scope.post(str, objWithUndefinedValue) inst = scope.post(str, str) inst = scope.post(str, strings) inst = scope.post(str, [num, str, regex]) -inst = scope.post(str, [num, num, num]) +inst = scope.post(str, [num, num, num] as const) inst = scope.post(str, regex) inst = scope.post(str, buffer) inst = scope.post(str, true) // $ExpectError