Created
October 23, 2021 21:42
-
-
Save n8rzz/5f0c3a07c11e03022fc8957abc325b69 to your computer and use it in GitHub Desktop.
max.test.ts - with variables
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
describe('.max()', () => { | |
describe('when `valueOne` is equal to `valueTwo`', () => { | |
test('should return `valueOne`', () => { | |
const valueOneMock = 1; | |
const valueTwoMock = 2; | |
const result = max(valueOneMock, valueTwoMock); | |
expect(result).toEqual(valueOneMock); | |
}); | |
}); | |
describe('when `valueOne` is less than `valueTwo`', () => { | |
test('should return `valueTwo`', () => { | |
const valueOneMock = 1; | |
const valueTwoMock = 2; | |
const result = max(valueOneMock, valueTwoMock); | |
expect(result).toEqual(valueTwoMock); | |
}); | |
}); | |
describe('when `valueOne` is greater than `valueTwo`', () => { | |
test('should return `valueOne`', () => { | |
const valueOneMock = 3; | |
const valueTwoMock = 2; | |
const result = max(valueOneMock, valueTwoMock); | |
expect(result).toEqual(valueOneMock); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment