Skip to content

Instantly share code, notes, and snippets.

@ollelauribostrom
Created July 30, 2018 20:45
Show Gist options
  • Save ollelauribostrom/ed76663a4d0f8ccfdd0f69b3ae42b527 to your computer and use it in GitHub Desktop.
Save ollelauribostrom/ed76663a4d0f8ccfdd0f69b3ae42b527 to your computer and use it in GitHub Desktop.
import inRange from '../src/inRange';
describe('{unit}: Testing inRange', () => {
it('should return true if in range', () => {
expect(inRange({ number: 5, low: 0, high: 10 })).toEqual(true);
});
it('should return false if not in range', () => {
expect(inRange({ number: 1, low: 5, high: 10 })).toEqual(false);
});
it('should include low value in range', () => {
expect(inRange({ number: 5, low: 5, high: 10 })).toEqual(true);
});
it('should include high value in range', () => {
expect(inRange({ number: 10, low: 0, high: 10 })).toEqual(true);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment