This repository was archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Unexpected rejection of the PR title: "PR's title is too short (8/8)" #646
Copy link
Copy link
Open
Description
The PR title check uses 'greater than' as operator:
zappr/server/checks/Specification.js
Line 26 in 25e001b
| const isLongEnough = (str, requiredLength) => (str || '').length > requiredLength |
This means that for a length of 8, it requires a length of 9 for the test to pass.
The error message will say: PR's title is too short (8/8).
This likely slipped through the tests, that verify the logic for 'short' which has 5 characters:
zappr/test/server/specification.test.js
Lines 84 to 100 in 25e001b
| it(`[action: '${action}'] should set status to 'failure' if PR's title's length is less than ${TITLE_REQUIRED_LENGTH}`, async (done) => { | |
| try { | |
| const title = 'short' | |
| const payload = createPayload(action, { | |
| title, | |
| state: 'open', | |
| body: 'This one is a good body for the PR' | |
| }) | |
| await pullRequest.execute(config(), payload, TOKEN) | |
| expect(github.setCommitStatus.calledWithExactly( | |
| 'sample', 'one', '1a2b3c', { | |
| state: 'failure', | |
| context: 'zappr/pr/specification', | |
| description: `PR's title is too short (${title.length}/${TITLE_REQUIRED_LENGTH})` | |
| }, 'token' | |
| )).to.be.true |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels