Created
September 26, 2020 12:46
-
-
Save janhesters/86c1255c8f2ba4990b33dca26ed686c3 to your computer and use it in GitHub Desktop.
Tests for the mock fuction.
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
import { describe } from 'riteway'; | |
import fn from './mock-fn.js'; | |
describe('fn - the mock function', async assert => { | |
const mockedFn = fn((a, b) => a + b); | |
assert({ | |
given: 'calling a mocked function', | |
should: 'should return the correct result', | |
actual: mockedFn(21, 21), | |
expected: 42, | |
}); | |
assert({ | |
given: "a mocked function's calls", | |
should: 'return the correct args', | |
actual: mockedFn.calls, | |
expected: [[21, 21]], | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment