import { joinPaths, hasChineseChar } from '.' describe('utils', () => { test('joinPaths #1', () => { expect(joinPaths('a', 'b')).toBe('a/b') }) test('joinPaths #2', () => { expect(joinPaths('/a', 'b')).toBe('/a/b') }) test('joinPaths #2.1', () => { expect(joinPaths('a', '/b')).toBe('/b') }) test('joinPaths #3', () => { expect(joinPaths('http://exp.com/a', 'b')).toBe('http://exp.com/a/b') }) describe('hasChineseChar', () => { test('#1', () => { expect(hasChineseChar('这')).toBe(true) expect(hasChineseChar('这2')).toBe(true) expect(hasChineseChar('2')).toBe(false) expect(hasChineseChar('a')).toBe(false) expect(hasChineseChar('a哈')).toBe(true) }) }) })