mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-25 04:54:08 -03:00
22 lines
728 B
JavaScript
22 lines
728 B
JavaScript
import { describe, it, expect, afterEach } from 'vitest';
|
|
|
|
import { getBasePath, withBasePath } from '../../../static/js/utils/basePath.js';
|
|
|
|
describe('static/js/utils/basePath.js', () => {
|
|
afterEach(() => {
|
|
delete window.LM_BASE_PATH;
|
|
});
|
|
|
|
it('returns empty base path when bootstrap did not set one', () => {
|
|
expect(getBasePath()).toBe('');
|
|
expect(withBasePath('/loras')).toBe('/loras');
|
|
});
|
|
|
|
it('prepends the detected base path', () => {
|
|
window.LM_BASE_PATH = '/comfyui';
|
|
expect(getBasePath()).toBe('/comfyui');
|
|
expect(withBasePath('/loras')).toBe('/comfyui/loras');
|
|
expect(withBasePath('/loras/recipes')).toBe('/comfyui/loras/recipes');
|
|
});
|
|
});
|