Skip to content

Instantly share code, notes, and snippets.

@5t33
Last active July 4, 2020 16:14
Show Gist options
  • Save 5t33/a0a32ac165b70c5f01c7fc80d9cdc4f6 to your computer and use it in GitHub Desktop.
Save 5t33/a0a32ac165b70c5f01c7fc80d9cdc4f6 to your computer and use it in GitHub Desktop.
const { ApiError } = require('./utils');
module.exports.functionThatRejectsWith400 = () => Promise.reject(
new ApiError(400, [
"wow you messed up, huh?",
"Looks like somebody didn't read the documentation."
])
)
module.exports.functionThatRejects = () => Promise.reject(new Error("Oh No"))
module.exports.functionThatResolves = () => Promise.resolve({so: "much", data: "wow"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment