import { describe, it, expect } from 'vitest';
import { applyVueSfcTemplateUpdate } from '../../packages/plugin/src/core/vueSfcUpdater';
function getLineColumnByToken(source: string, token: string): { line: number; column: number } {
const index = source.indexOf(token);
if (index < 0) {
throw new Error(`Token not found: ${token}`);
}
const prefix = source.slice(0, index);
const lines = prefix.split('\n');
return {
line: lines.length,
column: (lines[lines.length - 1] ?? '').length + 1,
};
}
describe('vueSfcUpdater', () => {
it('updates static class in Vue template', () => {
const source = `
Hello Vue
Hello Vue
Hello Agent
'); }); });