使用Sinon.js,如何在AWS S3中模拟deleteObject?

时间:2018-11-29 06:13:16

标签: javascript node.js amazon-s3 sinon

当我打印AWS.S3.prototype时,我得到:

  

服务{构造函数:{[功能]        超级:         {[功能:服务]           超级:[功能:对象],           defineMethods:[功能:defineMethods],           defineService:[功能:defineService],           addVersions:[功能:addVersions],           defineServiceApi:[功能:defineServiceApi],           hasService:[功能:hasService],           _serviceMap:[Object]},        服务:{'2006-03-01':[Object]},        apiVersions:['2006-03-01'],        serviceIdentifier:“ s3”,        ManagedUpload:         {[功能:ManagedUpload]           超级:[功能:对象],           addPromisesToClass:[功能:addPromisesToClass],           deletePromisesFromClass:[功能:deletePromisesFromClass]}},getSignatureVersion:[功能:getSignatureVersion],
  getSignerClass:[功能:getSignerClass],validateService:   [功能:validateService],应使用DisableBodySigning:[功能:   shouldDisableBodySigning],setupRequestListeners:[功能:   setupRequestListeners],validateScheme:[功能:validateScheme],   validateBucketEndpoint:[功能:validateBucketEndpoint],
  validateBucketName:[功能:validateBucketName],
  isValidAccelerateOperation:[功能:isValidAccelerateOperation],
  populateURI:[功能:populateURI],
  removeVirtualHostedBucketFromPath:[功能:   removeVirtualHostedBucketFromPath],addExpect100Continue:[功能:   addExpect100Continue],addContentType:[功能:addContentType],
  computableChecksumOperations:{putBucketCors:是的,        putBucketLifecycle:正确,        putBucketLifecycleConfiguration:true,        putBucketTagging:正确,        deleteObjects:是,        putBucketReplication:true},willComputeChecksums:[功能:willComputeChecksums],computeContentMd5:[功能:   [computeContentMd5],computeSseCustomerKeyMd5:[功能:   computeSseCustomerKeyMd5],pathStyleBucketName:[功能:   pathStyleBucketName],dnsCompatibleBucketName:[功能:   dnsCompatibleBucketName],成功响应:[功能:   successResponse],retryableError:[功能:retryableError],
  updateReqBucketRegion:[功能:updateReqBucketRegion],
  extractData:[功能:extractData],extractError:[功能:   extractError],requestBucketRegion:[功能:requestBucketRegion],   reqRegionForNetworkingError:[功能:reqRegionForNetworkingError],   bucketRegionCache:{},clearBucketRegionCache:[功能:   clearBucketRegionCache],correctBucketRegionFromCache:[功能:   CorrectBucketRegionFromCache],extractRequestIds:[功能:   extractRequestIds],getSignedUrl:[功能:getSignedUrl],
  createPresignedPost:[函数:createPresignedPost],
  preparePostFields:[功能:preparePostFields],preparePostPolicy:   [功能:preparePostPolicy],prepareSignedUrl:[功能:   prepareSignedUrl],disableBodySigning:[功能:   disableBodySigning],noPresignedContentLength:[功能:   noPresignedContentLength],createBucket:[Function:createBucket],
  上传:[功能:上传]}

我知道如何在原型中模拟函数,例如upload,但我根本看不到deleteObjects

如何模拟deleteObjects

0 个答案:

没有答案