Skip to content

Commit

Permalink
fix: undefined arg when request fails
Browse files Browse the repository at this point in the history
  • Loading branch information
nagpalkaran95 committed Dec 7, 2023
1 parent 50a8bf0 commit 0ca8b1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/commands/runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ module.exports = function run(args, rawArgs) {
// Hence whenever running on ATS, need to make local as false
bsConfig.connection_settings.local = false;

const gridDetails = await getTurboScaleGridDetails(bsConfig);
const gridDetails = await getTurboScaleGridDetails(bsConfig, args, rawArgs);

if (gridDetails && Object.keys(gridDetails).length > 0) {
Constants.turboScaleObj.gridDetails = gridDetails;
Expand Down
2 changes: 1 addition & 1 deletion bin/helpers/atsHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports.getTurboScaleGridName = (bsConfig) => {
return 'NO_GRID_NAME_PASSED';
};

exports.getTurboScaleGridDetails = async (bsConfig) => {
exports.getTurboScaleGridDetails = async (bsConfig, args, rawArgs) => {
try {
const gridName = this.getTurboScaleGridName(bsConfig);

Expand Down
4 changes: 2 additions & 2 deletions test/unit/bin/helpers/atsHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('#atsHelper', () => {

requestStub.yields(null, { statusCode: 200 }, body);
sendUsageReportStub.notCalled;
atsHelper.getTurboScaleGridDetails(testObjects.sampleATSBsConfigWithOptions).then((result) => {
atsHelper.getTurboScaleGridDetails(testObjects.sampleATSBsConfigWithOptions, {}, {}).then((result) => {
expect(result).to.eq(body);
})
});
Expand All @@ -104,7 +104,7 @@ describe('#atsHelper', () => {
};

requestStub.yields(null, { statusCode: 422 }, body);
atsHelper.getTurboScaleGridDetails(testObjects.sampleATSBsConfigWithOptions).then((result) => {
atsHelper.getTurboScaleGridDetails(testObjects.sampleATSBsConfigWithOptions, {}, {}).then((result) => {
expect(result).to.eq({});
expect(sendUsageReportStub.calledOnce).to.be.true;
})
Expand Down

0 comments on commit 0ca8b1a

Please sign in to comment.