This repository was archived by the owner on Jan 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
packages/s3-static-assets/tests Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11declare module "aws-sdk" {
22 const mockUpload : jest . Mock ;
33 const mockGetBucketAccelerateConfiguration : jest . Mock ;
4+ const mockGetBucketAccelerateConfigurationPromise : jest . Mock ;
45}
56
67const promisifyMock = ( mockFn : jest . Mock ) : jest . Mock => {
Original file line number Diff line number Diff line change 11import path from "path" ;
22import uploadStaticAssets from "../src/index" ;
33import { IMMUTABLE_CACHE_CONTROL_HEADER } from "../src/lib/constants" ;
4- import AWS , { mockGetBucketAccelerateConfiguration , mockUpload } from "aws-sdk" ;
5- import { mockGetBucketAccelerateConfigurationPromise } from "../__mocks__/aws-sdk" ;
4+ import AWS , {
5+ mockGetBucketAccelerateConfigurationPromise ,
6+ mockGetBucketAccelerateConfiguration ,
7+ mockUpload
8+ } from "aws-sdk" ;
9+
10+ // unfortunately can't use __mocks__ because aws-sdk is being mocked in other
11+ // packages in the monorepo
12+ // https://github.com/facebook/jest/issues/2070
13+ jest . mock ( "aws-sdk" , ( ) => require ( "./aws-sdk.mock" ) ) ;
614
715const upload = ( ) : Promise < AWS . S3 . ManagedUpload . SendData [ ] > => {
816 return uploadStaticAssets ( {
You can’t perform that action at this time.
0 commit comments