Skip to content

Instantly share code, notes, and snippets.

@n8rzz
Created October 23, 2021 21:42
Show Gist options
  • Save n8rzz/5f0c3a07c11e03022fc8957abc325b69 to your computer and use it in GitHub Desktop.
Save n8rzz/5f0c3a07c11e03022fc8957abc325b69 to your computer and use it in GitHub Desktop.
max.test.ts - with variables
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