paritytech / pr-custom-review

GitHub Action for complex pull request approval cases that are not currently supported by the Branch protection feature in GitHub.
MIT License
8 stars 4 forks source link

Add tests #31

Closed joao-paulo-parity closed 2 years ago

joao-paulo-parity commented 2 years ago

This PR

Demo PR: https://github.com/tripleightech/pr-custom-review-test/pull/8, e.g. https://github.com/tripleightech/pr-custom-review-test/runs/4834757447?check_suite_focus=true#step:2:21

close #18 close #28

joao-paulo-parity commented 2 years ago

8ecb5a1 has 81.01% coverage on what I care about

> npm run coverage
---------------|---------|----------|---------|---------|----------------------------------------------
File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                            
---------------|---------|----------|---------|---------|----------------------------------------------
All files      |   81.01 |    73.01 |     100 |   80.76 |                                              
 core.ts       |   80.64 |    73.01 |     100 |   80.39 | ...9,168-172,201-203,207,217-218,235-239,249 
 validation.ts |     100 |      100 |     100 |     100 |                                              
---------------|---------|----------|---------|---------|----------------------------------------------

The uncovered parts are related to error handling for the most part (should be covered by the catch in https://github.com/joao-paulo-parity/pr-custom-review/blob/8ecb5a1/src/main.ts#L113). The uncovered lines are not relevant right now since I am not testing errors. This can probably be improved in the future.

joao-paulo-parity commented 2 years ago

I don't see notice anything critical to be changed here based on the feedback. Most of it is tracked in #44 already.

Going forward with this merge in order to unblock the following PRs.