Skip to content

Instantly share code, notes, and snippets.

@subeshb1
Created June 10, 2020 15:29
Show Gist options
  • Save subeshb1/2e69c7acf0e63b3cf5f19b27314f5499 to your computer and use it in GitHub Desktop.
Save subeshb1/2e69c7acf0e63b3cf5f19b27314f5499 to your computer and use it in GitHub Desktop.
External script api-test
let testCase = process.argv[2]; // First arg will be test case key
let body = process.argv[3]; // Second arg will be body
let header = process.argv[4]; // Third arg will be header
let success = true;
switch (testCase) {
case "get_api":
if (success) {
process.exit(0); // For success case
} else {
process.exit(1); // For failure case
}
break;
case "invalid_post_api":
...
break;
default:
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment