Remove member-ordering and complexity eslint-disable comments by reordering class members and applying targeted fixes. Add metoyou/no-maybe-in-naming, type-safe WebRTC e2e harness helpers, and resolve remaining lint errors so npm run lint exits cleanly. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import {
|
|
describe,
|
|
expect,
|
|
it
|
|
} from 'vitest';
|
|
import { collectPluginReadRoots, fileUrlToPath } from './plugin-local-file.rules';
|
|
|
|
describe('plugin-local-file.rules', () => {
|
|
it('resolves linux file URLs to absolute paths', () => {
|
|
expect(fileUrlToPath('file:///home/ludde/Desktop/TestPlugin/plugin-source.json'))
|
|
.toBe('/home/ludde/Desktop/TestPlugin/plugin-source.json');
|
|
});
|
|
|
|
it('collects plugin read roots from source and entrypoint URLs', () => {
|
|
expect(collectPluginReadRoots(
|
|
'file:///home/ludde/Desktop/TestPlugin/plugin-source.json',
|
|
'file:///home/ludde/Desktop/TestPlugin/dist/main.js'
|
|
)).toEqual(['/home/ludde/Desktop/TestPlugin', '/home/ludde/Desktop/TestPlugin/dist']);
|
|
});
|
|
|
|
it('treats directory file URLs as their own read roots', () => {
|
|
expect(collectPluginReadRoots('file:///home/ludde/Desktop/TestPlugin/')).toEqual(['/home/ludde/Desktop/TestPlugin']);
|
|
|
|
expect(collectPluginReadRoots('file:///home/ludde/Desktop/TestPlugin')).toEqual(['/home/ludde/Desktop/TestPlugin']);
|
|
});
|
|
});
|