Created
September 16, 2019 16:34
-
-
Save joeskeen/cf823a9eee56a7336197c4b858f16d03 to your computer and use it in GitHub Desktop.
a sample specification for a function that determines whether a given value is an integer
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
describe('isInteger', () => { | |
describe('when provided an integer value', () => { | |
it('should classify 5 as an integer'); | |
it('should classify -5 as an integer'); | |
it('should classify 0 as an integer'); | |
}); | |
describe('when provided a numerical value that is not an integer', () => { | |
it('should classify 3.14 as not an integer'); | |
it('should classify -3.14 as not an integer'); | |
it('should classify NaN as not an integer'); | |
}); | |
describe('when provided a non-numerical value', () => { | |
it('should classify null as not an integer'); | |
it('should classify undefined as not an integer'); | |
it('should classify true as not an integer'); | |
it('should classify false as not an integer'); | |
it('should classify {} as not an integer'); | |
it('should classify [] as not an integer'); | |
it('should classify '' as not an integer'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment