Skip to content

Instantly share code, notes, and snippets.

@mrcampbell
Last active December 8, 2019 21:47
Show Gist options
  • Save mrcampbell/13e2dc85b78722bdf4c93bfd6575db4b to your computer and use it in GitHub Desktop.
Save mrcampbell/13e2dc85b78722bdf4c93bfd6575db4b to your computer and use it in GitHub Desktop.
gist for "tests: another form of documentation", medium blog post
function createUser(name, age, address) {
if (age < 13) {
throw Error("user must be older than 13 to register")
}
// insert into database, then return result
return db.insertUser({name, age, address})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment