Skip to content

Instantly share code, notes, and snippets.

@olivierpicault
Last active December 3, 2019 15:22
Show Gist options
  • Save olivierpicault/6addff6666559a731497de8ad9bd4a05 to your computer and use it in GitHub Desktop.
Save olivierpicault/6addff6666559a731497de8ad9bd4a05 to your computer and use it in GitHub Desktop.
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