Skip to content

Commit 2250b88

Browse files
committed
tests: endpoint config option
1 parent 8f5940f commit 2250b88

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/unit/lib/s3-test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,27 @@ describe('s3', function() {
195195
});
196196
});
197197

198+
it('allows `endpoint` option to be passed to customize storage', function() {
199+
var endpoint = 'foo.bar.baz';
200+
subject = new S3({
201+
plugin: Object.assign(plugin, {
202+
readConfig: function(propertyName) {
203+
if (propertyName === 's3Client') {
204+
return s3Client;
205+
} else if (propertyName === 'endpoint') {
206+
return endpoint;
207+
}
208+
}
209+
})
210+
});
211+
var promise = subject.upload(options);
212+
return assert.isFulfilled(promise)
213+
.then(function() {
214+
assert.equal(require('aws-sdk').config.endpoint.host, endpoint, 'Endpoint in SDK is correct');
215+
assert.equal(mockUi.messages[0], '- Using endpoint from config', 'Prefix is included in log output');
216+
});
217+
});
218+
198219
it('allows `cacheControl` option to be passed to customize the used cache-control', function() {
199220
var cacheControl = 'max-age=3600';
200221

0 commit comments

Comments
 (0)