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

      AWS SDK Vitest Mock - API Reference - v1.0.6

      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);

      Interfaces - Command Stub

      AwsCommandStub

      Interfaces - Core Functions

      AwsClientStub

      Interfaces - Matchers

      AwsSdkMatchers

      Variables - Matchers

      matchers

      Functions - Core Functions

      setGlobalDebug
      mockClient
      mockClientInstance