Last active
December 3, 2019 15:22
-
-
Save olivierpicault/6addff6666559a731497de8ad9bd4a05 to your computer and use it in GitHub Desktop.
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 isObject from './isObject' | |
describe('isObject', () => { | |
test('String', () => { | |
expect(isObject('myString')).toEqual(false) | |
}) | |
test('Object', () => { | |
expect(isObject({ param: 'value' })).toEqual(true) | |
}) | |
test('Array', () => { | |
expect(isObject(['a', 'b', 'c'])).toEqual(false) | |
}) | |
test('Set', () => { | |
expect(isObject(new Set([1, 2, 4]))).toEqual(false) | |
}) | |
test('Date', () => { | |
expect(isObject(new Date())).toEqual(false) | |
}) | |
test('Undefined', () => { | |
expect(isObject(undefined)).toEqual(false) | |
}) | |
test('Null', () => { | |
expect(isObject(null)).toEqual(false) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment