UNPKG

msw

Version:

The industry standard for API mocking in JavaScript.

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…', ) })