import { testSuite } from '@sidetree/cas' ; import S3Cas from './S3Cas' ; import MockS3Cas from './MockS3Cas' ; import casConfig from './cas-config.json' ; import AWS from 'aws-sdk/global' ; const forceMock = true ; const config = new AWS . Config ( ) ; if ( process . env . NODE_ENV !== 'test' ) { if ( forceMock ) { console . warn ( 'Using mock s3 interface for S3 tests' ) ; } else if ( ! config . credentials ) { console . warn ( 'No AWS credentials found in ~/.aws/credentials, using mock interace' ) ; } } const cas = config . credentials && ! forceMock ? new S3Cas ( casConfig . s3BucketName ) : new MockS3Cas ( ) ; testSuite ( cas ) ;