mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-29 18:50:36 +00:00
13
web_src/js/utils/string.test.ts
Normal file
13
web_src/js/utils/string.test.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {cutString} from './string.ts';
|
||||
|
||||
test('cutString', () => {
|
||||
let [before, after, ok] = cutString('a = b = c', '=');
|
||||
expect(before).toBe('a ');
|
||||
expect(after).toBe(' b = c');
|
||||
expect(ok).toBe(true);
|
||||
|
||||
[before, after, ok] = cutString(' a ', '=');
|
||||
expect(before).toBe(' a ');
|
||||
expect(after).toBe('');
|
||||
expect(ok).toBe(false);
|
||||
});
|
||||
Reference in New Issue
Block a user