AWS SDK Vitest Mock - API Reference - v1.0.93
    Preparing search index...

      AWS SDK Vitest Mock - API Reference - v1.0.93

      AWS SDK Vitest Mock - A powerful, type-safe mocking library for AWS SDK v3 with Vitest

      import { mockClient } from 'aws-sdk-vitest-mock';
      import { S3Client, GetObjectCommand } from '@aws-sdk/client-s3';

      const s3Mock = mockClient(S3Client);
      s3Mock.on(GetObjectCommand).resolves({ Body: 'file contents' });

      const client = new S3Client({});
      const result = await client.send(new GetObjectCommand({ Bucket: 'test', Key: 'file.txt' }));
      import { expect } from 'vitest';
      import { matchers } from 'aws-sdk-vitest-mock';

      expect.extend(matchers);

      expect(s3Mock).toHaveReceivedCommand(GetObjectCommand);
      AwsCommandStub
      AwsClientStub
      MatcherResult
      AwsSdkMatchers
      PaginatorOptions
      MockOptions
      StreamInput
      DeepPartial
      StructuralCommand
      CommandConstructor
      AwsCommandConstructor
      CommandInputType
      CommandOutputType
      AnyClient
      AwsSdkCommand
      ClientConstructor
      CommandHandler
      matchers
      setGlobalDebug
      mockClient
      mockClientInstance