Skip to content

Commit

Permalink
fix: some formatting issues when printing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
prototypicalpro committed Sep 3, 2020
1 parent 63d878b commit f1c341e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions __tests__/createOrUpdateIssue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function atLeastObject(matcher: {
}

describe('createOrUpdateIssue', () => {
// supress github actions commands inside tests
beforeEach(() => process.stdout.write('::stop-commands::running-tests\n'))
afterEach(() => process.stdout.write('::running-tests::\n'))
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const client: any = new Octokit()

Expand Down
4 changes: 4 additions & 0 deletions __tests__/getConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import * as yaml from 'js-yaml'
import nock from 'nock'

describe('getConfig', () => {
// supress github actions commands inside tests
beforeEach(() => process.stdout.write('::stop-commands::running-tests\n'))
afterEach(() => process.stdout.write('::running-tests::\n'))

test('getConfig returns a config from a JSON file', async () => {
const filepath = path.resolve(__dirname, 'testconfig.json')
const expected = JSON.parse(await fs.promises.readFile(filepath, 'utf8'))
Expand Down
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ function run(disableRetry) {
}
catch (error) {
// set the outputs for this action
core.endGroup();
core.setOutput("errored" /* ERRORED */, true);
core.setOutput("passed" /* PASSED */, false);
core.setFailed('A fatal error was thrown.');
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export default async function run(disableRetry?: boolean): Promise<void> {
)
} catch (error) {
// set the outputs for this action
core.endGroup()
core.setOutput(Outputs.ERRORED, true)
core.setOutput(Outputs.PASSED, false)
core.setFailed('A fatal error was thrown.')
Expand Down

0 comments on commit f1c341e

Please sign in to comment.