Skip to content

Commit

Permalink
Fix deprecated warning annotation conditional (#16)
Browse files Browse the repository at this point in the history
* fix deprecated warning annotation conditional

* ncc

* bump pkg json
  • Loading branch information
robherley committed Apr 7, 2024
1 parent 929eebe commit 4dc302c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
17 changes: 17 additions & 0 deletions __tests__/inputs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,21 @@ describe('renderer', () => {
)
expect(core.warning).toHaveBeenCalled()
})

it('does not make an annotation if the deprecated inputs are not used', () => {
mockGetInput.mockImplementation((name: string) => {
switch (name) {
case 'omitUntestedPackages':
case 'omitSuccessfulPackages':
case 'omitPie':
return 'false'
default:
return ''
}
})
mockGetBooleanInput.mockReturnValue(false)

getInputs()
expect(core.warning).not.toHaveBeenCalled()
})
})
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "go-test-action",
"version": "0.4.0",
"version": "0.4.1",
"description": "GitHub Action to run go tests with rich summary output and annotations.",
"main": "dist/index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,24 @@ function getDeprecatedOmitInputs(): OmitOption[] {

const omitUntestedPackages = core.getInput('omitUntestedPackages')
if (omitUntestedPackages) {
usedDeprecated.push('omitUntestedPackages')
if (core.getBooleanInput('omitUntestedPackages')) {
usedDeprecated.push('omitUntestedPackages')
omitOptions.push(OmitOption.Untested)
}
}

const omitSuccessfulPackages = core.getInput('omitSuccessfulPackages')
if (omitSuccessfulPackages) {
usedDeprecated.push('omitSuccessfulPackages')
if (core.getBooleanInput('omitSuccessfulPackages')) {
usedDeprecated.push('omitSuccessfulPackages')
omitOptions.push(OmitOption.Successful)
}
}

const omitPie = core.getInput('omitPie')
if (omitPie) {
usedDeprecated.push('omitPie')
if (core.getBooleanInput('omitPie')) {
usedDeprecated.push('omitPie')
omitOptions.push(OmitOption.Pie)
}
}
Expand Down

0 comments on commit 4dc302c

Please sign in to comment.