Skip to content

Commit 90c7b8d

Browse files
committed
fix(deps): complete typescript-eslint v8 migration
Merge the latest main branch, align ESLint with the v8 peer range, address review feedback, and cover malformed TestNG output diagnostics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2 parents 0264ac2 + 8743c03 commit 90c7b8d

5 files changed

Lines changed: 78 additions & 106 deletions

File tree

‎package-lock.json‎

Lines changed: 49 additions & 100 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,15 +558,15 @@
558558
"@types/lru-cache": "^7.10.10",
559559
"@types/mocha": "^9.1.1",
560560
"@types/node": "^16.18.13",
561-
"@types/sinon": "^10.0.13",
561+
"@types/sinon": "^22.0.0",
562562
"@types/vscode": "1.125.0",
563563
"@typescript-eslint/eslint-plugin": "^8.67.0",
564564
"@typescript-eslint/parser": "^8.67.0",
565565
"@vscode/test-electron": "^3.1.0",
566-
"eslint": "^8.43.0",
566+
"eslint": "^8.57.0",
567567
"glob": "^7.2.3",
568568
"mocha": "^11.1.0",
569-
"sinon": "^14.0.2",
569+
"sinon": "^22.1.0",
570570
"ts-loader": "^9.4.2",
571571
"typescript": "^4.9.4",
572572
"webpack": "^5.109.2",

‎src/runners/testngRunner/TestNGRunnerResultAnalyzer.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export class TestNGRunnerResultAnalyzer extends RunnerResultAnalyzer {
4848
while ((match = this.regex.exec(data)) !== null) {
4949
try {
5050
this.processData(match[1]);
51-
} catch {
52-
this.testContext.testRun.appendOutput(`[ERROR] Failed to parse output data: ${match[1]}\r\n`);
51+
} catch (error) {
52+
this.testContext.testRun.appendOutput(`[ERROR] Failed to parse output data: ${match[1]}. ${String(error)}\r\n`);
5353
}
5454
}
5555
}

‎src/utils/configUtils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function filterCandidateConfigItems(configItems: IExecutionConfig[], testItems:
5757
try {
5858
return checkTestItems(testItems, context);
5959
} catch {
60-
// do something with the error
60+
// Ignore invalid when clauses so the configuration remains selectable.
6161
}
6262
}
6363

‎test/suite/TestNGAnalyzer.test.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,29 @@ suite('TestNG Runner Analyzer Tests', () => {
7272
sinon.assert.notCalled(appendOutputSpy);
7373
});
7474

75+
test('includes parsing errors in malformed runner output diagnostics', () => {
76+
const testItem = generateTestItem(testController, 'testng@example.SampleTest#test', TestKind.TestNG);
77+
const testRun = testController.createTestRun(new TestRunRequest([testItem], []));
78+
const appendOutputSpy = sinon.spy(testRun, 'appendOutput');
79+
const runnerContext: IRunTestContext = {
80+
isDebug: false,
81+
kind: TestKind.TestNG,
82+
projectName: 'testng',
83+
testItems: [testItem],
84+
testRun,
85+
workspaceFolder: workspace.workspaceFolders?.[0]!,
86+
};
87+
const analyzer = new TestNGRunnerResultAnalyzer(runnerContext);
88+
89+
analyzer.analyzeData('@@<TestRunner-{invalid}-TestRunner>');
90+
91+
sinon.assert.calledOnce(appendOutputSpy);
92+
sinon.assert.calledWith(
93+
appendOutputSpy,
94+
sinon.match(/^\[ERROR\] Failed to parse output data: \{invalid\}\. SyntaxError:/),
95+
);
96+
});
97+
7598
test('reports method results without assigning a result state to the class', () => {
7699
const classItem = testController.createTestItem('testng@example.SampleTest', 'SampleTest');
77100
dataCache.set(classItem, {

0 commit comments

Comments
 (0)