-
-
Notifications
You must be signed in to change notification settings - Fork 87
Make S3Overrides accessible via E-Var or option AND tests #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
14f3f56
4abb443
fd7ba2b
87e3b2a
7986b61
03fd287
4ab310e
e18efe8
eae68ec
311a44d
bcc7ef4
0ee6e5e
5690044
2b9fe8f
078a342
344cfb3
d4a3881
a4bce1e
a19d31d
803523a
747a17e
ddc96f6
8725059
fcf3d39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,25 @@ describe('S3Adapter tests', () => { | |
expect(options.bucketPrefix).toEqual('test/'); | ||
}); | ||
|
||
it('should accept options and overrides as an option in args', () => { | ||
var confObj = { bucketPrefix: 'test/', bucket: 'bucket-1', secretKey: 'secret-1', accessKey: 'key-1' ,s3overrides: { secretAccessKey: 'secret-2', accessKeyId: 'key-2', params: { Bucket: 'bucket-2' }} }; | ||
var s3 = new S3Adapter(confObj); | ||
expect(s3._s3Client.config.accessKeyId).toEqual('key-2'); | ||
expect(s3._s3Client.config.secretAccessKey).toEqual('secret-2'); | ||
expect(s3._s3Client.config.params.Bucket).toEqual('bucket-2'); | ||
expect(s3._bucketPrefix).toEqual('test/'); | ||
}); | ||
|
||
it('should accept options and overrides as an Enviromental Variable', () => { | ||
var confObj = { bucketPrefix: 'test/', bucket: 'bucket-1', secretKey: 'secret-1', accessKey: 'key-1'}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why'd you take out that trailing space? for consistency, there should be a space between the that's how all the other object spacing is done in the file. we just want to be consistent, when possible we put those consistency rules into lint so we don't have to think about it...... |
||
process.env.S3_OVERRIDES = { secretAccessKey: 'secret-2', accessKeyId: 'key-2', params: { Bucket: 'bucket-2' }}; | ||
var s3 = new S3Adapter(confObj); | ||
expect(s3._s3Client.config.accessKeyId).toEqual('key-2'); | ||
expect(s3._s3Client.config.secretAccessKey).toEqual('secret-2'); | ||
expect(s3._s3Client.config.params.Bucket).toEqual('bucket-2'); | ||
expect(s3._bucketPrefix).toEqual('test/'); | ||
}); | ||
|
||
it('should accept options and overrides as args', () => { | ||
var confObj = { bucketPrefix: 'test/', bucket: 'bucket-1', secretKey: 'secret-1', accessKey: 'key-1' }; | ||
var overridesObj = { secretAccessKey: 'secret-2', accessKeyId: 'key-2', params: { Bucket: 'bucket-2' }}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a space after the comma
it should be
, s3over....
not
,s3over...