mirror of
https://github.com/peter-evans/dockerhub-description.git
synced 2024-11-21 19:49:32 +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('😀😁')
|
||
|
})
|
||
|
})
|