- src/test 迁移至根目录 tests/(16 测试 + fixtures/manual),导入改为 ../src/ - 新增 tsconfig.test.json 独立编译测试;.vscode-test.mjs / package.json / .gitignore 同步 - 新增 tests/test-execution-log.md、tests/test-cases.md(116 用例清单) - 新增 tests/measure/measure-review-time.mjs + performance-comparison.md(提效测量) - 重命名 3 个中文报告文件为 demo-*-coverage-report.md - git rm --cached 解除 vsix 跟踪;README 标注演示视频进行中
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import * as assert from 'assert';
|
|
import * as vscode from 'vscode';
|
|
import * as path from 'path';
|
|
import { ESLintAdapter } from '../src/adapters/eslint';
|
|
import { mergeResults } from '../src/merger/merger';
|
|
|
|
suite('Pipeline Tests', () => {
|
|
test('Full pipeline: linter check + merge', async () => {
|
|
const adapter = new ESLintAdapter();
|
|
if (!adapter.isAvailable()) { return; }
|
|
|
|
const doc = await vscode.workspace.openTextDocument({
|
|
content: 'var x = 1;\nvar y = 2;\n',
|
|
language: 'javascript',
|
|
});
|
|
|
|
const staticResult = await adapter.check(doc, __dirname);
|
|
assert.ok(staticResult.status === 'ok');
|
|
|
|
const report = mergeResults({
|
|
staticDiagnostics: staticResult.diagnostics,
|
|
customRuleResults: [],
|
|
translatedDiagnostics: [],
|
|
aiFindings: [],
|
|
errors: [],
|
|
degraded: false,
|
|
startTime: Date.now(),
|
|
filePath: 'virtual-doc',
|
|
language: 'javascript',
|
|
adapterIds: ['eslint'],
|
|
});
|
|
|
|
assert.ok(typeof report.duration === 'number');
|
|
assert.ok(typeof report.linterCount === 'number');
|
|
assert.strictEqual(report.language, 'javascript');
|
|
});
|
|
});
|