package.test.index.test.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of is-what Show documentation
Show all versions of is-what Show documentation
JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.
The newest version!
// @ts-check
import {
isBlob,
isFile,
} from '../dist/index.cjs'
test('isBlob', () => {
expect(isBlob(Blob)).toBe(false)
expect(isBlob(new Blob())).toBe(true)
})
test('isFile', () => {
expect(isFile(File)).toBe(false)
expect(isFile(new File([''], '', { type: 'text/html' }))).toBe(true)
})