Skip to content

Commit

Permalink
fix(types): allow readonly arrays for data matcher in types (#2215)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurence-myers committed Jul 4, 2021
1 parent c852f79 commit 940f4b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
.cache
.idea
.nyc_output
.vscode
coverage
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Expand Up @@ -52,7 +52,7 @@ declare namespace nock {
| RegExp
| DataMatcherArray
| DataMatcherMap
interface DataMatcherArray extends Array<DataMatcher> {}
interface DataMatcherArray extends ReadonlyArray<DataMatcher> {}
interface DataMatcherMap {
[key: string]: DataMatcher
}
Expand Down
2 changes: 1 addition & 1 deletion types/tests.ts
Expand Up @@ -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
Expand Down

0 comments on commit 940f4b7

Please sign in to comment.