Skip to content
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
8 changes: 4 additions & 4 deletions clients/client-s3/test/e2e/S3.browser.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { S3, SelectObjectContentEventStream } from "@aws-sdk/client-s3";
import type { S3, SelectObjectContentEventStream, waitUntilObjectExists } from "@aws-sdk/client-s3";
import { fromNodeProviderChain } from "@aws-sdk/credential-providers";
import { FetchHttpHandler } from "@smithy/fetch-http-handler";
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, onTestFailed, test as it } from "vitest";

import { getIntegTestResources } from "../../../../tests/e2e/get-integ-test-resources";
import { getRuntimeConfig } from "../../src/runtimeConfig.browser";
import { S3 as S3Impl, waitUntilObjectExists } from "../browser-build/browser-s3-bundle";
import { S3 as S3Impl, waitUntilObjectExists as waitUntilObjectExistsImpl } from "../browser-build/browser-s3-bundle";
import { createBuffer } from "./helpers";

describe("@aws-sdk/client-s3", () => {
Expand Down Expand Up @@ -242,8 +242,8 @@ describe("@aws-sdk/client-s3", () => {
});
expect(completeResult.$metadata.httpStatusCode).toEqual(200);

//validate the object is uploaded
const waiterState = await waitUntilObjectExists(
// validate the object is uploaded
const waiterState = await (waitUntilObjectExistsImpl as typeof waitUntilObjectExists)(
{
client,
maxWaitTime: 60,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,17 @@ describe("credential-provider-node integration test", () => {
aws_secret_access_key: "INI_STATIC_SECRET_KEY",
});

sts = new STS({
region: "us-west-2",
logger: {
trace() {},
debug() {},
info() {},
warn() {},
error() {},
},
});

await sts.getCallerIdentity({});
const credentials = await sts.config.credentials();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { S3 } from "@aws-sdk/client-s3";
import { AwsCredentialIdentity } from "@aws-sdk/types";
import { describe, expect, expect, test as it } from "vitest";
import { AwsCredentialIdentity, AwsSdkFeatures } from "@aws-sdk/types";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../../../private/aws-util-test/src";
import { S3ExpressIdentity, S3ExpressIdentityProvider } from "./index";
Expand Down Expand Up @@ -94,7 +94,10 @@ describe("middleware-s3-express", () => {

requireRequestsFrom(client).toMatch({
headers: {
"user-agent": /(.*?) m\/(.*?)J(.*?)$/,
["user-agent"](ua) {
const metadata = ua.match(/(.*?) m\/(.*?)$/)[2];
expect(metadata).toContain("J" as AwsSdkFeatures["S3_EXPRESS_BUCKET"]);
},
},
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { CodeCatalyst } from "@aws-sdk/client-codecatalyst";
import { DynamoDB } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
import { describe, test as it } from "vitest";
import { AwsSdkFeatures } from "@aws-sdk/types";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../../private/aws-util-test/src";

Expand Down Expand Up @@ -38,7 +39,13 @@ describe("middleware-user-agent", () => {

requireRequestsFrom(doc).toMatch({
headers: {
"user-agent": /(.*?) m\/d,E,O,R$/,
["user-agent"](ua) {
const metadata = ua.match(/(.*?) m\/(.*?)$/)[2];
expect(metadata).toContain("d" as AwsSdkFeatures["DDB_MAPPER"]);
expect(metadata).toContain("E" as AwsSdkFeatures["RETRY_MODE_STANDARD"]);
expect(metadata).toContain("O" as AwsSdkFeatures["ACCOUNT_ID_ENDPOINT"]);
expect(metadata).toContain("R" as AwsSdkFeatures["ACCOUNT_ID_MODE_REQUIRED"]);
},
},
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test as it, describe, expect } from "vitest";
import { describe, expect, test as it } from "vitest";

// import { JsonProtocol } from "@aws-sdk/aws-protocoltests-json";
// CI has difficult importing a named private client from the workspace.
Expand Down
Loading