diff --git a/Tasks/DotNetCoreCLIV2/Tests/L0.ts b/Tasks/DotNetCoreCLIV2/Tests/L0.ts index eec3247855e1..c1833ea3006f 100644 --- a/Tasks/DotNetCoreCLIV2/Tests/L0.ts +++ b/Tasks/DotNetCoreCLIV2/Tests/L0.ts @@ -208,7 +208,7 @@ describe('DotNetCoreExe Suite', function () { assert(tr.failed, 'task should have failed'); }); - it('test throws warning when zero match found', async () => { + it('test fails when zero match found', async () => { process.env["__projects__"] = "*fail*/project.json"; process.env["__command__"] = "test"; let tp = path.join(__dirname, 'validInputs.js') @@ -216,8 +216,7 @@ describe('DotNetCoreExe Suite', function () { await tr.runAsync(); assert(tr.invokedToolCount == 0, 'should not have invoked tool'); - assert(tr.succeeded, 'task should have succeeded'); - assert(tr.warningIssues && tr.warningIssues.length, 'Should have thrown a warning in the stream'); + assert(tr.failed, 'task should have failed'); }); it('publish works with explicit project files setting modifyoutput to false', async () => { diff --git a/Tasks/DotNetCoreCLIV2/dotnetcore.ts b/Tasks/DotNetCoreCLIV2/dotnetcore.ts index 25c60249b25f..567d19d4964f 100644 --- a/Tasks/DotNetCoreCLIV2/dotnetcore.ts +++ b/Tasks/DotNetCoreCLIV2/dotnetcore.ts @@ -178,8 +178,7 @@ export class dotNetExe { // Use empty string when no project file is specified to operate on the current directory const projectFiles = this.getProjectFiles(); if (projectFiles.length === 0) { - tl.warning(tl.loc('noProjectFilesFound')); - return; + throw tl.loc('noProjectFilesFound'); } const failedProjects: string[] = [];