diff --git a/.gitignore b/.gitignore index a44a138..2b2207c 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,9 @@ typings/ # Secret files .secrets + +# bin folder +bin/ + +# obj folder +obj/ \ No newline at end of file diff --git a/__tests__/cake.test.ts b/__tests__/cake.test.ts index 2cd8736..af1963c 100644 --- a/__tests__/cake.test.ts +++ b/__tests__/cake.test.ts @@ -1,16 +1,15 @@ +import * as path from 'path'; import { exec } from '@actions/exec'; import { which } from '@actions/io'; -import * as path from 'path'; - import * as cake from '../src/cake'; -import { CakeArgument, CakeSwitch } from '../src/cakeParameter'; -import { CakeToolSettings } from '../src/cakeToolSettings'; import { ToolsDirectory } from '../src/toolsDirectory'; +import { CakeToolSettings } from '../src/cakeToolSettings'; +import { CakeArgument, CakeSwitch } from '../src/cakeParameter'; const pathToLocalToolsDirectory = path.join('path', 'to', 'tool'); const pathToLocalTool = path.join(pathToLocalToolsDirectory, 'dotnet-cake'); -const dotnetManifestCake = 'dotnet tool run dotnet-cake'; const pathToCsprojFile = path.join('build', 'Build.csproj'); +const dotnetManifestCake = 'dotnet tool run dotnet-cake'; const dotnetRun = 'dotnet run'; jest.mock('@actions/exec'); @@ -244,7 +243,7 @@ describe('When failing to run a Cake Frosting Project', () => { fakeExec.mockReturnValue(Promise.resolve(-21)); }); - test('it should throw error when csproj-path does not exist', async () => { + test('it should throw an error containing the exit code', async () => { await expect(cake.runProject('', new ToolsDirectory())).rejects.toThrow('-21'); }); }); diff --git a/src/action.ts b/src/action.ts index 2cedfc7..319a184 100644 --- a/src/action.ts +++ b/src/action.ts @@ -1,5 +1,4 @@ import * as core from '@actions/core'; - import * as script from './cakeParameter'; import * as input from './input'; diff --git a/src/cake.ts b/src/cake.ts index 7ff30e2..b73d317 100644 --- a/src/cake.ts +++ b/src/cake.ts @@ -31,7 +31,7 @@ export async function runProject( const exitCode = await exec(dotnetRun, [ '--project', csprojPath, '--no-launch-profile', - '--verbosity', 'minimal', + '-v', 'minimal', '--configuration', 'Release', `--paths_tools="${toolsDir}"`, ...cakeParams