Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from mheffner/fix/catch-vol-type-mismatch
Browse files Browse the repository at this point in the history
Catch error when size (as number) is passed as vol type.
  • Loading branch information
mheffner committed Jul 22, 2019
2 parents cfb9aff + 4d87336 commit 374947a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions/ebs.ts
Expand Up @@ -20,7 +20,7 @@ function _ec2_ebs(settings: InvocationSettings, storageType: EBSStorageType, vol
}

if (volumeType) {
volumeType = volumeType.toLowerCase()
volumeType = volumeType.toString().toLowerCase()
}

let ebsPrices = new EBSPrice(settings, storageType, volumeType, volumeUnits.toString())
Expand Down
4 changes: 4 additions & 0 deletions tests/functions/ebs_test.ts
Expand Up @@ -72,6 +72,10 @@ export class EBSFunctionTestSuite extends TestSuite {
t.willThrow(function() {
EC2_EBS_GP2_GB("foo", "us-east-1")
}, "unable to parse volume units")

t.willThrow(function() {
EC2_EBS_GB(s, 400, "gp2")
}, "invalid EBS volume type")
})
}
}

0 comments on commit 374947a

Please sign in to comment.