mirror of
https://github.com/peter-evans/dockerhub-description.git
synced 2024-11-23 04:29:33 +01:00
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('😀😁')
|
||
|
})
|
||
|
})
|