mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-03 05:55:03 +01:00
14 lines
600 B
TypeScript
14 lines
600 B
TypeScript
import { splitStringEveryNCharacters } from '../src/splitStringEveryNCharacters';
|
|
|
|
describe(splitStringEveryNCharacters.name, () => {
|
|
it('splits string into parts of N characters', () => {
|
|
expect(splitStringEveryNCharacters('123456789', 0)).toStrictEqual([]);
|
|
|
|
const expectedFor1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
expect(splitStringEveryNCharacters('123456789', 1)).toStrictEqual(expectedFor1);
|
|
|
|
const expectedFor2 = ['12', '34', '56', '78', '9'];
|
|
expect(splitStringEveryNCharacters('123456789', 2)).toStrictEqual(expectedFor2);
|
|
});
|
|
});
|