@@ -122,16 +122,7 @@ describe('S3Adapter tests', () => {
122
122
expect ( options . bucket ) . toEqual ( 'bucket' ) ;
123
123
expect ( options . bucketPrefix ) . toEqual ( 'test/' ) ;
124
124
} ) ;
125
-
126
- it ( 'should accept options and overrides as args' , ( ) => {
127
- var confObj = { bucketPrefix : 'test/' , bucket : 'bucket-1' , secretKey : 'secret-1' , accessKey : 'key-1' } ;
128
- var overridesObj = { secretAccessKey : 'secret-2' , accessKeyId : 'key-2' , params : { Bucket : 'bucket-2' } } ;
129
- var s3 = new S3Adapter ( confObj , overridesObj ) ;
130
- expect ( s3 . _s3Client . config . accessKeyId ) . toEqual ( 'key-2' ) ;
131
- expect ( s3 . _s3Client . config . secretAccessKey ) . toEqual ( 'secret-2' ) ;
132
- expect ( s3 . _s3Client . config . params . Bucket ) . toEqual ( 'bucket-2' ) ;
133
- expect ( s3 . _bucketPrefix ) . toEqual ( 'test/' ) ;
134
- } ) ;
125
+
135
126
it ( 'should accept options and overrides as an option in args' , ( ) => {
136
127
var confObj = { bucketPrefix : 'test/' , bucket : 'bucket-1' , secretKey : 'secret-1' , accessKey : 'key-1' , s3overrides : { secretAccessKey : 'secret-2' , accessKeyId : 'key-2' , params : { Bucket : 'bucket-2' } } } ;
137
128
var s3 = new S3Adapter ( confObj ) ;
@@ -150,18 +141,17 @@ describe('S3Adapter tests', () => {
150
141
expect ( s3 . _s3Client . config . params . Bucket ) . toEqual ( 'bucket-2' ) ;
151
142
expect ( s3 . _bucketPrefix ) . toEqual ( 'test/' ) ;
152
143
} ) ;
153
-
154
- it ( 'should accept overrides without params ' , ( ) => {
144
+
145
+ it ( 'should accept options and overrides as args ' , ( ) => {
155
146
var confObj = { bucketPrefix : 'test/' , bucket : 'bucket-1' , secretKey : 'secret-1' , accessKey : 'key-1' } ;
156
- var overridesObj = { secretAccessKey : 'secret-2' } ;
147
+ var overridesObj = { secretAccessKey : 'secret-2' , accessKeyId : 'key-2' , params : { Bucket : 'bucket-2' } } ;
157
148
var s3 = new S3Adapter ( confObj , overridesObj ) ;
158
- expect ( s3 . _s3Client . config . accessKeyId ) . toEqual ( 'key-1 ' ) ;
149
+ expect ( s3 . _s3Client . config . accessKeyId ) . toEqual ( 'key-2 ' ) ;
159
150
expect ( s3 . _s3Client . config . secretAccessKey ) . toEqual ( 'secret-2' ) ;
160
- expect ( s3 . _s3Client . config . params . Bucket ) . toEqual ( 'bucket-1 ' ) ;
151
+ expect ( s3 . _s3Client . config . params . Bucket ) . toEqual ( 'bucket-2 ' ) ;
161
152
expect ( s3 . _bucketPrefix ) . toEqual ( 'test/' ) ;
162
153
} ) ;
163
154
} ) ;
164
- } ) ;
165
155
166
156
describe ( 'getFileLocation' , ( ) => {
167
157
var config = {
0 commit comments