Skip to content

Commit

Permalink
Fix test compilation issue
Browse files Browse the repository at this point in the history
Following solution outlined in this thread: m-radzikowski/aws-sdk-client-mock#167

Does not appear to cause any further issues with the Typescript
  • Loading branch information
TomJKing committed Jul 13, 2023
1 parent 730fe40 commit abf825b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion npm/test/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ test("'scheduleTokenRefresh' should not refresh tokens if the access token has n
test("'scheduleTokenRefresh' should not refresh tokens if there is no refresh token", async () => {
const mockUpdateToken = jest.fn()
const isTokenExpired = true
const noRefreshToken = undefined
const noRefreshToken: any = undefined
const mockKeycloak: KeycloakInstance = createMockKeycloakInstance(mockUpdateToken, isTokenExpired, noRefreshToken)

jest.useFakeTimers()
Expand Down
4 changes: 2 additions & 2 deletions npm/test/s3upload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IFileWithPath,
IProgressInformation
} from "@nationalarchives/file-information"
import { mockClient } from "aws-sdk-client-mock"
import {AwsClientStub, mockClient} from "aws-sdk-client-mock"

import {
CreateMultipartUploadCommand,
Expand All @@ -31,7 +31,7 @@ interface ITdrFileWithPathAndBits extends ITdrFileWithPath {
bits: Buffer
}

const s3Mock = mockClient(S3Client)
const s3Mock: AwsClientStub<S3Client> = mockClient(S3Client)

const userId = "b088d123-1280-4959-91ca-74858f7ba226"

Expand Down
2 changes: 1 addition & 1 deletion npm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"esModuleInterop": true,
"sourceMap": true,
"moduleResolution": "node",
"strict": true
"strictFunctionTypes": true
},
"include": ["src/*"],
"exclude": ["dist/**"]
Expand Down

0 comments on commit abf825b

Please sign in to comment.