Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1411 from jeskew/chore/coverage-gap
Add test to make sure all clients can be instantiated
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ coverage: | |
status: | ||
project: | ||
default: | ||
target: 90.5% | ||
target: 95% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var AWS = require('../index'); | ||
var metadata = require('../apis/metadata'); | ||
var apiLoader = require('../lib/api_loader'); | ||
var customConstructorArgs = { | ||
CloudSearchDomain: {endpoint: 'http://localhost:1337'}, | ||
IotData: {endpoint: 'http://localhost:1337'} | ||
}; | ||
|
||
for (var serviceAbbreviation in metadata) { | ||
var clientName = metadata[serviceAbbreviation].name; | ||
describe( | ||
'Instantiating AWS.' + clientName + ' clients', | ||
(function(clientName, serviceAbbreviation) { | ||
return function() { | ||
for (var version in apiLoader.services[serviceAbbreviation]) { | ||
it( | ||
'can instantiate AWS.' + clientName + ' clients with version ' + version, | ||
(function (clientName, version) { | ||
return function () { | ||
var params = customConstructorArgs[clientName] || {}; | ||
params.version = version; | ||
var c = new AWS[clientName](params); | ||
}; | ||
})(clientName, version) | ||
); | ||
} | ||
} | ||
})(clientName, serviceAbbreviation) | ||
); | ||
} |