From 1397b99b7c2bf8a3feadebbd8514d6d97385803f Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Tue, 25 Jun 2024 14:09:10 +0200 Subject: [PATCH] Refactor `dotnet-nunit` parser to `DotnetNunitParser` --- __tests__/dotnet-nunit.test.ts | 4 ++-- dist/index.js | 8 ++++---- src/main.ts | 4 ++-- src/parsers/dotnet-nunit/dotnet-nunit-parser.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/__tests__/dotnet-nunit.test.ts b/__tests__/dotnet-nunit.test.ts index 731aeeab..e0b47783 100644 --- a/__tests__/dotnet-nunit.test.ts +++ b/__tests__/dotnet-nunit.test.ts @@ -1,7 +1,7 @@ import * as fs from 'fs' import * as path from 'path' -import {DotNetNunitParser} from '../src/parsers/dotnet-nunit/dotnet-nunit-parser' +import {DotnetNunitParser} from '../src/parsers/dotnet-nunit/dotnet-nunit-parser' import {ParseOptions} from '../src/test-parser' import {getReport} from '../src/report/get-report' import {normalizeFilePath} from '../src/utils/path-utils' @@ -18,7 +18,7 @@ describe('dotnet-nunit tests', () => { trackedFiles: ['DotnetTests.Unit/Calculator.cs', 'DotnetTests.NUnitV3Tests/CalculatorTests.cs'] } - const parser = new DotNetNunitParser(opts) + const parser = new DotnetNunitParser(opts) const result = await parser.parse(filePath, fileContent) expect(result).toMatchSnapshot() diff --git a/dist/index.js b/dist/index.js index 323abc0a..ff99141e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -427,7 +427,7 @@ class TestReporter { case 'dart-json': return new dart_json_parser_1.DartJsonParser(options, 'dart'); case 'dotnet-nunit': - return new dotnet_nunit_parser_1.DotNetNunitParser(options); + return new dotnet_nunit_parser_1.DotnetNunitParser(options); case 'dotnet-trx': return new dotnet_trx_parser_1.DotnetTrxParser(options); case 'flutter-json': @@ -742,12 +742,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DotNetNunitParser = void 0; +exports.DotnetNunitParser = void 0; const xml2js_1 = __nccwpck_require__(6189); const node_utils_1 = __nccwpck_require__(5824); const path_utils_1 = __nccwpck_require__(4070); const test_results_1 = __nccwpck_require__(2768); -class DotNetNunitParser { +class DotnetNunitParser { constructor(options) { this.options = options; } @@ -852,7 +852,7 @@ class DotNetNunitParser { return ((_b = (_a = this.options.workDir) !== null && _a !== void 0 ? _a : this.assumedWorkDir) !== null && _b !== void 0 ? _b : (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); } } -exports.DotNetNunitParser = DotNetNunitParser; +exports.DotnetNunitParser = DotnetNunitParser; /***/ }), diff --git a/src/main.ts b/src/main.ts index 458d1066..d50427b1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,7 +11,7 @@ import {getAnnotations} from './report/get-annotations' import {getReport} from './report/get-report' import {DartJsonParser} from './parsers/dart-json/dart-json-parser' -import {DotNetNunitParser} from './parsers/dotnet-nunit/dotnet-nunit-parser' +import {DotnetNunitParser} from './parsers/dotnet-nunit/dotnet-nunit-parser' import {DotnetTrxParser} from './parsers/dotnet-trx/dotnet-trx-parser' import {JavaJunitParser} from './parsers/java-junit/java-junit-parser' import {JestJunitParser} from './parsers/jest-junit/jest-junit-parser' @@ -216,7 +216,7 @@ class TestReporter { case 'dart-json': return new DartJsonParser(options, 'dart') case 'dotnet-nunit': - return new DotNetNunitParser(options) + return new DotnetNunitParser(options) case 'dotnet-trx': return new DotnetTrxParser(options) case 'flutter-json': diff --git a/src/parsers/dotnet-nunit/dotnet-nunit-parser.ts b/src/parsers/dotnet-nunit/dotnet-nunit-parser.ts index 70d3269a..4bc27f1f 100644 --- a/src/parsers/dotnet-nunit/dotnet-nunit-parser.ts +++ b/src/parsers/dotnet-nunit/dotnet-nunit-parser.ts @@ -14,7 +14,7 @@ import { TestCaseError } from '../../test-results' -export class DotNetNunitParser implements TestParser { +export class DotnetNunitParser implements TestParser { assumedWorkDir: string | undefined constructor(readonly options: ParseOptions) {}