mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
508 B
TypeScript
15 lines
508 B
TypeScript
import { markAbsoluteUrl } from '../url-helper';
|
|
|
|
describe('markAbsoluteUrl', () => {
|
|
test.each([
|
|
['bar', 'https://www.example.com/foo/bar'],
|
|
['./bar', 'https://www.example.com/foo/bar'],
|
|
['../bar', 'https://www.example.com/bar'],
|
|
['/bar', 'https://www.example.com/bar'],
|
|
['https://www.baidu.com', 'https://www.baidu.com/'],
|
|
['https://www.baidu.com/search', 'https://www.baidu.com/search'],
|
|
])('%s', (input, output) => {
|
|
expect(markAbsoluteUrl(input)).toBe(output);
|
|
});
|
|
});
|