@aws-sdk/client-cost-and-usage-report-service-node
Version:
Node SDK for AWS Cost and Usage Report Service
63 lines • 3.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var CostandUsageReportServiceClient_1 = require("../../CostandUsageReportServiceClient");
var DescribeReportDefinitionsCommand_1 = require("../../commands/DescribeReportDefinitionsCommand");
function smokeTestRunner() {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var defaultRegion, testFailed;
var _this = this;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
defaultRegion = process.env.AWS_SMOKE_TEST_REGION || "us-east-1";
testFailed = false;
console.log("1..1");
console.log("# Running tests for Cost and Usage Report Service.");
return [4 /*yield*/, (function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var client, command, result, err_1;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
client = new CostandUsageReportServiceClient_1.CostandUsageReportServiceClient({
region: defaultRegion
});
command = new DescribeReportDefinitionsCommand_1.DescribeReportDefinitionsCommand({});
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, client.send(command)];
case 2:
result = _a.sent();
console.log("ok Cost and Usage Report Service DescribeReportDefinitions - no error expected from service");
return [3 /*break*/, 4];
case 3:
err_1 = _a.sent();
console.log("not ok Cost and Usage Report Service DescribeReportDefinitions - no error expected from service");
// output unexpected error information
console.log("# " + err_1.message);
err_1.stack.split("\n").forEach(function (line) {
console.log("# " + line);
});
testFailed = true;
return [3 /*break*/, 4];
case 4: return [2 /*return*/];
}
});
}); })()];
case 1:
_a.sent();
if (testFailed) {
process.exit(1);
}
else {
process.exit(0);
}
return [2 /*return*/];
}
});
});
}
// execute the test runner
smokeTestRunner();
//# sourceMappingURL=index.spec.js.map