-
-
Save isaacs/007528c82130613f83c669a2a746b490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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