mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
d905b7598d
* chore: port karma tests * chore: port karma tests * chore: port karma tests * chore: tests * chore: tests * chore: tests * chore: fix issues with port collisions * refactor: utils tests * refactor: utils tests * refactor: utils tests * refactor: tests to vitests * refactor: tests to vitests * refactor: tests to vitests * refactor: tests to vitests * refactor: tests to vitests * refactor: tests to vitests * refactor: tests to vitests * refactor: ci * chore: install pw deps * chore: fixx ai feedback * chore: wip compatability tests * chore: wip compatability tests * chore: wip compatability tests * refactor: wip smoke * chore: smoke test run * chore: update unzip * chore: update testing * chore: update testing * chore: update testing * chore: update testing * chore: update testing * chore: skip tests that cannot run on node 16 and lower * chore: fix 16x under tests * chore: rest of tests * fix: functions and runs * feat: added tests for esm smoke * feat: added smoke * chore: ignore ai gen plans * chore: ci fixes * chore: fix small p2s
25 lines
943 B
JavaScript
25 lines
943 B
JavaScript
import { describe, it, expect } from 'vitest';
|
|
import combineURLs from '../../../lib/helpers/combineURLs.js';
|
|
|
|
describe('helpers::combineURLs', () => {
|
|
it('should combine URLs', () => {
|
|
expect(combineURLs('https://api.github.com', '/users')).toBe('https://api.github.com/users');
|
|
});
|
|
|
|
it('should remove duplicate slashes', () => {
|
|
expect(combineURLs('https://api.github.com/', '/users')).toBe('https://api.github.com/users');
|
|
});
|
|
|
|
it('should insert missing slash', () => {
|
|
expect(combineURLs('https://api.github.com', 'users')).toBe('https://api.github.com/users');
|
|
});
|
|
|
|
it('should not insert slash when relative url missing/empty', () => {
|
|
expect(combineURLs('https://api.github.com/users', '')).toBe('https://api.github.com/users');
|
|
});
|
|
|
|
it('should allow a single slash for relative url', () => {
|
|
expect(combineURLs('https://api.github.com/users', '/')).toBe('https://api.github.com/users/');
|
|
});
|
|
});
|