mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 22:07:09 +01:00
Refactor dotnet-nunit parser to DotnetNunitParser
This commit is contained in:
parent
d8481703bc
commit
1397b99b7c
4 changed files with 9 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import * as path from 'path'
|
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 {ParseOptions} from '../src/test-parser'
|
||||||
import {getReport} from '../src/report/get-report'
|
import {getReport} from '../src/report/get-report'
|
||||||
import {normalizeFilePath} from '../src/utils/path-utils'
|
import {normalizeFilePath} from '../src/utils/path-utils'
|
||||||
|
|
@ -18,7 +18,7 @@ describe('dotnet-nunit tests', () => {
|
||||||
trackedFiles: ['DotnetTests.Unit/Calculator.cs', 'DotnetTests.NUnitV3Tests/CalculatorTests.cs']
|
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)
|
const result = await parser.parse(filePath, fileContent)
|
||||||
expect(result).toMatchSnapshot()
|
expect(result).toMatchSnapshot()
|
||||||
|
|
||||||
|
|
|
||||||
8
dist/index.js
generated
vendored
8
dist/index.js
generated
vendored
|
|
@ -427,7 +427,7 @@ class TestReporter {
|
||||||
case 'dart-json':
|
case 'dart-json':
|
||||||
return new dart_json_parser_1.DartJsonParser(options, 'dart');
|
return new dart_json_parser_1.DartJsonParser(options, 'dart');
|
||||||
case 'dotnet-nunit':
|
case 'dotnet-nunit':
|
||||||
return new dotnet_nunit_parser_1.DotNetNunitParser(options);
|
return new dotnet_nunit_parser_1.DotnetNunitParser(options);
|
||||||
case 'dotnet-trx':
|
case 'dotnet-trx':
|
||||||
return new dotnet_trx_parser_1.DotnetTrxParser(options);
|
return new dotnet_trx_parser_1.DotnetTrxParser(options);
|
||||||
case 'flutter-json':
|
case 'flutter-json':
|
||||||
|
|
@ -742,12 +742,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.DotNetNunitParser = void 0;
|
exports.DotnetNunitParser = void 0;
|
||||||
const xml2js_1 = __nccwpck_require__(6189);
|
const xml2js_1 = __nccwpck_require__(6189);
|
||||||
const node_utils_1 = __nccwpck_require__(5824);
|
const node_utils_1 = __nccwpck_require__(5824);
|
||||||
const path_utils_1 = __nccwpck_require__(4070);
|
const path_utils_1 = __nccwpck_require__(4070);
|
||||||
const test_results_1 = __nccwpck_require__(2768);
|
const test_results_1 = __nccwpck_require__(2768);
|
||||||
class DotNetNunitParser {
|
class DotnetNunitParser {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
this.options = 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)));
|
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;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {getAnnotations} from './report/get-annotations'
|
||||||
import {getReport} from './report/get-report'
|
import {getReport} from './report/get-report'
|
||||||
|
|
||||||
import {DartJsonParser} from './parsers/dart-json/dart-json-parser'
|
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 {DotnetTrxParser} from './parsers/dotnet-trx/dotnet-trx-parser'
|
||||||
import {JavaJunitParser} from './parsers/java-junit/java-junit-parser'
|
import {JavaJunitParser} from './parsers/java-junit/java-junit-parser'
|
||||||
import {JestJunitParser} from './parsers/jest-junit/jest-junit-parser'
|
import {JestJunitParser} from './parsers/jest-junit/jest-junit-parser'
|
||||||
|
|
@ -216,7 +216,7 @@ class TestReporter {
|
||||||
case 'dart-json':
|
case 'dart-json':
|
||||||
return new DartJsonParser(options, 'dart')
|
return new DartJsonParser(options, 'dart')
|
||||||
case 'dotnet-nunit':
|
case 'dotnet-nunit':
|
||||||
return new DotNetNunitParser(options)
|
return new DotnetNunitParser(options)
|
||||||
case 'dotnet-trx':
|
case 'dotnet-trx':
|
||||||
return new DotnetTrxParser(options)
|
return new DotnetTrxParser(options)
|
||||||
case 'flutter-json':
|
case 'flutter-json':
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import {
|
||||||
TestCaseError
|
TestCaseError
|
||||||
} from '../../test-results'
|
} from '../../test-results'
|
||||||
|
|
||||||
export class DotNetNunitParser implements TestParser {
|
export class DotnetNunitParser implements TestParser {
|
||||||
assumedWorkDir: string | undefined
|
assumedWorkDir: string | undefined
|
||||||
|
|
||||||
constructor(readonly options: ParseOptions) {}
|
constructor(readonly options: ParseOptions) {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue