Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix type errors in integ tests #6054

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ jest.mock("@aws-sdk/client-sso", () => {
};
});

let stsSpy: jest.Spied<any> | any | undefined = undefined;
// This var must be hoisted.
// eslint-disable-next-line no-var
var stsSpy: jest.Spied<any> | any | undefined = undefined;

jest.mock("@aws-sdk/client-sts", () => {
const actual = jest.requireActual("@aws-sdk/client-sts");

const originalSend = actual.STSClient.prototype.send;

stsSpy = jest.spyOn(actual.STSClient.prototype, "send").mockImplementation(async function (command: any) {
stsSpy = jest.spyOn(actual.STSClient.prototype, "send").mockImplementation(async function (this: any, command: any) {
if (command.constructor.name === "AssumeRoleCommand") {
return {
Credentials: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("middleware-eventstream", () => {
[Symbol.asyncIterator]() {
return {
next() {
return this;
return this as any;
},
};
},
Expand Down Expand Up @@ -57,7 +57,7 @@ describe("middleware-eventstream", () => {
[Symbol.asyncIterator]() {
return {
next() {
return this;
return this as any;
},
};
},
Expand Down Expand Up @@ -87,7 +87,7 @@ describe("middleware-eventstream", () => {
[Symbol.asyncIterator]() {
return {
next() {
return this;
return this as any;
},
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { AwsCredentialIdentity } from "@smithy/types";
import crypto from "crypto";
import { Readable } from "stream";

import sqsModel from "../../../codegen/sdk-codegen/aws-models/sqs.json";
import { requireRequestsFrom } from "../../../private/aws-util-test/src";

const sqsModel: any = require("../../../codegen/sdk-codegen/aws-models/sqs.json");
const useAwsQuery = !!sqsModel.shapes["com.amazonaws.sqs#AmazonSQS"].traits["aws.protocols#awsQuery"];

let hashError = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("middleware-sdk-transcribe-streaming", () => {
MediaEncoding: "pcm",
AudioStream: {
[Symbol.asyncIterator]() {
return this;
return this as any;
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("middleware-websocket", () => {
ChallengeVersions: "a,b,c",
LivenessRequestStream: {
[Symbol.asyncIterator]() {
return this;
return this as any;
},
},
});
Expand Down
Loading