Skip to content

Commit

Permalink
Updated publish methods to keep it compatible (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
egor-bryzgalov authored Jan 12, 2021
1 parent b2c18db commit c05b4fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-pipelines-task-lib",
"version": "2.12.0",
"version": "2.12.1",
"description": "Azure Pipelines Task SDK",
"main": "./task.js",
"typings": "./task.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions node/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1776,12 +1776,12 @@ export class TestPublisher {
constructor(public testRunner: string) {
}

public publish(resultFiles?: string[], mergeResults?: string, platform?: string, config?: string, runTitle?: string, publishRunAttachments?: string, testRunSystem?: string) {
public publish(resultFiles?: string | string[], mergeResults?: string, platform?: string, config?: string, runTitle?: string, publishRunAttachments?: string, testRunSystem?: string) {
// Could have used an initializer, but wanted to avoid reordering parameters when converting to strict null checks
// (A parameter cannot both be optional and have an initializer)
testRunSystem = testRunSystem || "VSTSTask";

var properties = <{ [key: string]: string | string[] }>{};
var properties = <{ [key: string]: string }>{};
properties['type'] = this.testRunner;

if (mergeResults) {
Expand All @@ -1805,7 +1805,7 @@ export class TestPublisher {
}

if (resultFiles) {
properties['resultFiles'] = resultFiles;
properties['resultFiles'] = Array.isArray(resultFiles) ? resultFiles.join() : resultFiles;
}

properties['testRunSystem'] = testRunSystem;
Expand All @@ -1820,7 +1820,7 @@ export class TestPublisher {
export class CodeCoveragePublisher {
constructor() {
}
public publish(codeCoverageTool?: string, summaryFileLocation?: string, reportDirectory?: string, additionalCodeCoverageFiles?: string) {
public publish(codeCoverageTool?: string, summaryFileLocation?: string, reportDirectory?: string, additionalCodeCoverageFiles?: string | string[]) {

var properties = <{ [key: string]: string }>{};

Expand All @@ -1837,7 +1837,7 @@ export class CodeCoveragePublisher {
}

if (additionalCodeCoverageFiles) {
properties['additionalcodecoveragefiles'] = additionalCodeCoverageFiles;
properties['additionalcodecoveragefiles'] = Array.isArray(additionalCodeCoverageFiles) ? additionalCodeCoverageFiles.join() : additionalCodeCoverageFiles;
}

command('codecoverage.publish', properties, "");
Expand Down

0 comments on commit c05b4fe

Please sign in to comment.