UNPKG

msw

Version:

Seamless REST/GraphQL API mocking library for browser and Node.js.

17 lines (13 loc) • 513 B
import { getMessageLength } from './get-message-length' test('returns the length of the string', () => { expect(getMessageLength('')).toBe(0) expect(getMessageLength('hello')).toBe(5) }) test('returns the size of the Blob', () => { expect(getMessageLength(new Blob())).toBe(0) expect(getMessageLength(new Blob(['hello']))).toBe(5) }) test('returns the byte length of ArrayBuffer', () => { expect(getMessageLength(new ArrayBuffer(0))).toBe(0) expect(getMessageLength(new ArrayBuffer(5))).toBe(5) })