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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { HttpResponse } from "@smithy/protocol-http";
import { Readable } from "stream";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../../../private/aws-util-test/src";
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aws-sdk/aws-util-test/src with the /src part is preferred for this specific package because there are vitest function calls in the module.

Importing with @aws-sdk/aws-util-test instead imports the built version of the library, which is incompatible with vitest (CJS).


describe("selectObjectContent", () => {
const credentials = {
Expand Down
3 changes: 1 addition & 2 deletions lib/lib-dynamodb/src/test/mutability.integ.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { DynamoDB, ScanCommand } from "@aws-sdk/client-dynamodb";
import { HeadBucketCommand, HeadBucketCommandInput, S3Client } from "@aws-sdk/client-s3";
import { DynamoDBDocument, ScanCommand as DocumentScanCommand, ScanCommandInput } from "@aws-sdk/lib-dynamodb";
import { describe, expect, test as it } from "vitest";

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

describe("DynamoDBDocument command mutability", () => {
it("should allow sending the same command more than once without mutating the Command instance", async () => {
const ddb = new DynamoDB({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { TimestreamQuery } from "@aws-sdk/client-timestream-query";
import { TimestreamWrite } from "@aws-sdk/client-timestream-write";
import { EndpointCache } from "@aws-sdk/endpoint-cache";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-endpoint-discovery", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { LexRuntimeV2 } from "@aws-sdk/client-lex-runtime-v2";
import { RekognitionStreaming } from "@aws-sdk/client-rekognitionstreaming";
import { TranscribeStreaming } from "@aws-sdk/client-transcribe-streaming";
import { Decoder, Encoder, EventStreamPayloadHandlerProvider } from "@smithy/types";
import { describe, expect, test as it, vi } from "vitest";

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

describe("middleware-eventstream", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { S3 } from "@aws-sdk/client-s3";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-expect-continue", () => {
describe(S3.name, () => {
it("should not set expect header if there is no body", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Required for testing CRC64NVME
import "@aws-sdk/crc64-nvme-crt";

import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { ChecksumAlgorithm, S3 } from "@aws-sdk/client-s3";
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { Readable, Transform } from "stream";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../../private/aws-util-test/src";
import { DEFAULT_CHECKSUM_ALGORITHM, RequestChecksumCalculation, ResponseChecksumValidation } from "./constants";

describe("middleware-flexible-checksums", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { S3 } from "@aws-sdk/client-s3";
import { retryMiddleware } from "@smithy/middleware-retry";
import { HttpResponse } from "@smithy/protocol-http";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-flexible-checksums.retry", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { SageMaker } from "@aws-sdk/client-sagemaker";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-host-header", () => {
describe(SageMaker.name, () => {
it("should set the host header", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { S3 } from "@aws-sdk/client-s3";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-location-constraint", () => {
describe(S3.name, () => {
it("should set on input CreateBucketConfiguration and LocationConstraint", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { CloudFront } from "@aws-sdk/client-cloudfront";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-location-constraint", () => {
describe(CloudFront.name, () => {
it("should have no effect on request creation", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { Lambda } from "@aws-sdk/client-lambda";
import { describe, expect, test as it } from "vitest";

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

const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
const ENV_TRACE_ID = "_X_AMZN_TRACE_ID";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { APIGateway } from "@aws-sdk/client-api-gateway";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-sdk-api-gateway", () => {
describe(APIGateway.name, () => {
it("should add default accept header", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { Glacier } from "@aws-sdk/client-glacier";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-sdk-glacier", () => {
describe(Glacier.name, () => {
it("should set a default account id", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { MachineLearning } from "@aws-sdk/client-machine-learning";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-sdk-machine-learning", () => {
describe(MachineLearning.name, () => {
it("should use the input predict endpoint", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { Route53 } from "@aws-sdk/client-route-53";
import { XMLParser } from "fast-xml-parser";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-sdk-route53", () => {
describe(Route53.name, () => {
it("should normalize param names HostedZoneId", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { S3Control } from "@aws-sdk/client-s3-control";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-sdk-s3-control", () => {
describe(S3Control.name, () => {
it("dedupes host prefixes", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { S3 } from "@aws-sdk/client-s3";
import { describe, expect, test as it, vi } from "vitest";

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

describe("middleware-sdk-s3", () => {
describe(S3.name, () => {
it("validates bucket names", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { S3 } from "@aws-sdk/client-s3";
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";

describe("middleware-s3-express", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { SQS } from "@aws-sdk/client-sqs";
import { HttpHandler, HttpResponse } from "@smithy/protocol-http";
import type { AwsCredentialIdentity } from "@smithy/types";
import crypto from "crypto";
import { Readable } from "stream";
import { beforeEach, describe, expect, test as it } from "vitest";

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"];
const isAwsQueryCompatible =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { TranscribeStreaming } from "@aws-sdk/client-transcribe-streaming";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-sdk-transcribe-streaming", () => {
// TODO: http2 in CI
describe.skip(TranscribeStreaming.name, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { EC2 } from "@aws-sdk/client-ec2";
import { SageMaker } from "@aws-sdk/client-sagemaker";
import { describe, test as it } from "vitest";

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

describe("middleware-signing", () => {
describe(EC2.name, () => {
it("sign requests in the header", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { S3 } from "@aws-sdk/client-s3";
import * as crypto from "crypto";
import { describe, test as it } from "vitest";

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

// "server-side-encryption"
describe("middleware-ssec", () => {
describe(S3.name, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { CodeCatalyst } from "@aws-sdk/client-codecatalyst";
import { describe, test as it } from "vitest";

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

describe("middleware-token", () => {
describe(CodeCatalyst.name, () => {
it("sets bearer token authorization header", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { CodeCatalyst } from "@aws-sdk/client-codecatalyst";
import { DynamoDB } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
import { AwsSdkFeatures } from "@aws-sdk/types";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-user-agent", () => {
describe(CodeCatalyst.name, () => {
it("sets the SDK user agent", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { RekognitionStreaming } from "@aws-sdk/client-rekognitionstreaming";
import { describe, test as it } from "vitest";

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

describe("middleware-websocket", () => {
const logger = {
trace() {},
Expand Down
3 changes: 1 addition & 2 deletions packages/util-endpoints/src/env-endpoint.integ.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";
import { DynamoDB } from "@aws-sdk/client-dynamodb";
import { S3 } from "@aws-sdk/client-s3";
import { afterAll, beforeEach, describe, test as it } from "vitest";

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

/**
* This is an AWS-specific integration test for a piece of functionality that is contained
* within `@smithy/middleware-endpoint` (another repository).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { S3Control } from "@aws-sdk/client-s3-control";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-apply-body-checksum", () => {
describe(S3Control.name, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { S3 } from "@aws-sdk/client-s3";
import { XRay } from "@aws-sdk/client-xray";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-content-length", () => {
describe(AccessAnalyzer.name, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { S3 } from "@aws-sdk/client-s3";
import { S3Control } from "@aws-sdk/client-s3-control";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-endpoint", () => {
// these are token examples because most endpoint
Expand Down
2 changes: 1 addition & 1 deletion private/aws-middleware-test/src/middleware-retry.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Lambda } from "@aws-sdk/client-lambda";
import { describe, expect, test as it } from "vitest";

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

describe("middleware-retry", () => {
describe(Lambda.name, () => {
Expand Down
2 changes: 1 addition & 1 deletion private/aws-middleware-test/src/util-stream.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fromUtf8 } from "@smithy/util-utf8";
import { Readable } from "stream";
import { describe, expect, test as it } from "vitest";

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

describe("util-stream", () => {
describe(Lambda.name, () => {
Expand Down
2 changes: 1 addition & 1 deletion private/aws-util-test/src/clients/Weather.integ.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Weather } from "@aws-sdk/weather";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../requests/test-http-handler";
import { requireRequestsFrom } from "@aws-sdk/aws-util-test/src";

describe(Weather.name, () => {
it("should be able to make a request without errors", async () => {
Expand Down
Loading