Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created April 15, 2019 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/007528c82130613f83c669a2a746b490 to your computer and use it in GitHub Desktop.
Save isaacs/007528c82130613f83c669a2a746b490 to your computer and use it in GitHub Desktop.
'use strict'
// test/basic.js
const tap = require('./')
const mam = function (x) {
if (x % 2 === 0) {
return 'even'
} else if (x % 2 === 1) {
return 'odd'
} else if (x > 100) {
return 'big'
} else if (x < 0) {
return 'negative'
}
}
// Always call as (found, wanted) by convention
tap.equal(mam(1), 'odd')
tap.equal(mam(2), 'even')
tap.equal(mam(200), 'big')
tap.equal(mam(-10), 'negative')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment