UNPKG

msw

Version:

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

13 lines (10 loc) • 335 B
import { truncateMessage } from './truncate-message' test('returns a short string as-is', () => { expect(truncateMessage('')).toBe('') expect(truncateMessage('hello')).toBe('hello') }) test('truncates a long string', () => { expect(truncateMessage('this is a very long string')).toBe( 'this is a very long stri…', ) })