Skip to content

Commit

Permalink
test(endpoint): add test cases for useFipsEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Nov 10, 2021
1 parent cace36c commit 44144ba
Show file tree
Hide file tree
Showing 3 changed files with 6,357 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/endpoint/index.spec.js
@@ -0,0 +1,39 @@
const testCases = require('./test_cases_supported.json');
const helpers = require('../helpers');
const AWS = helpers.AWS;

describe('endpoints', () => {
beforeEach(function () {
helpers.mockResponse({
data: {},
});
});

for (const {
clientName,
region,
useFipsEndpoint,
hostname,
} of testCases) {
it(`testing "${clientName}" with region: ${region}`, (done) => {
if (!AWS[clientName]) {
throw new Error(`${clientName} does not exist`);
}

const client = new AWS[clientName]({
region,
useFipsEndpoint,
hostPrefixEnabled: false
});

const req = client[Object.keys(client.api.operations)[0]]();

req.on('complete', function () {
expect(hostname).to.equal(req.httpRequest.endpoint.host);
done();
});

req.send(function () {});
});
}
});

0 comments on commit 44144ba

Please sign in to comment.