Created
April 19, 2022 19:53
-
-
Save HonzaMac/02f9290c3991ef65b8db703c6153dc73 to your computer and use it in GitHub Desktop.
Run node:test runner via node isOdd.test.js
This file contains hidden or 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
// Run via: node isOdd.test.js | |
import test from 'node:test' | |
import assert from 'assert' | |
const isOdd = (val) => val % 2 | |
test('isOdd', () => { | |
[[1, true], [2, false]].forEach(([input, expected]) => { | |
test(`Is Odd for value ${input}`, () => { | |
assert.equal(isOdd(input), expected) | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment