Some checks failed
Publish Docker Image / publish (push) Has been cancelled
* feat: truncate short description exceeding the byte limit * fix tests
11 lines
349 B
TypeScript
11 lines
349 B
TypeScript
import {truncateToBytes} from '../src/utils'
|
|
|
|
describe('truncate to bytes tests', () => {
|
|
test('unicode aware truncation to a number of bytes', async () => {
|
|
expect(truncateToBytes('test string to be truncated', 10)).toEqual(
|
|
'test strin'
|
|
)
|
|
expect(truncateToBytes('😀😁😂🤣😃😄😅', 10)).toEqual('😀😁')
|
|
})
|
|
})
|