Skip to content

Commit 4dc302c

Browse files
authored
Fix deprecated warning annotation conditional (#16)
* fix deprecated warning annotation conditional * ncc * bump pkg json
1 parent 929eebe commit 4dc302c

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

__tests__/inputs.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,21 @@ describe('renderer', () => {
8080
)
8181
expect(core.warning).toHaveBeenCalled()
8282
})
83+
84+
it('does not make an annotation if the deprecated inputs are not used', () => {
85+
mockGetInput.mockImplementation((name: string) => {
86+
switch (name) {
87+
case 'omitUntestedPackages':
88+
case 'omitSuccessfulPackages':
89+
case 'omitPie':
90+
return 'false'
91+
default:
92+
return ''
93+
}
94+
})
95+
mockGetBooleanInput.mockReturnValue(false)
96+
97+
getInputs()
98+
expect(core.warning).not.toHaveBeenCalled()
99+
})
83100
})

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "go-test-action",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "GitHub Action to run go tests with rich summary output and annotations.",
55
"main": "dist/index.js",
66
"scripts": {

src/inputs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,24 @@ function getDeprecatedOmitInputs(): OmitOption[] {
7878

7979
const omitUntestedPackages = core.getInput('omitUntestedPackages')
8080
if (omitUntestedPackages) {
81-
usedDeprecated.push('omitUntestedPackages')
8281
if (core.getBooleanInput('omitUntestedPackages')) {
82+
usedDeprecated.push('omitUntestedPackages')
8383
omitOptions.push(OmitOption.Untested)
8484
}
8585
}
8686

8787
const omitSuccessfulPackages = core.getInput('omitSuccessfulPackages')
8888
if (omitSuccessfulPackages) {
89-
usedDeprecated.push('omitSuccessfulPackages')
9089
if (core.getBooleanInput('omitSuccessfulPackages')) {
90+
usedDeprecated.push('omitSuccessfulPackages')
9191
omitOptions.push(OmitOption.Successful)
9292
}
9393
}
9494

9595
const omitPie = core.getInput('omitPie')
9696
if (omitPie) {
97-
usedDeprecated.push('omitPie')
9897
if (core.getBooleanInput('omitPie')) {
98+
usedDeprecated.push('omitPie')
9999
omitOptions.push(OmitOption.Pie)
100100
}
101101
}

0 commit comments

Comments
 (0)