Add rule to require assertion count assertion
See original GitHub issueI always try to add a expect.assertions(<number of assertions>)
call to the top of every test I write. It helps me keep track of the assertions I am using, and prevents accidental adding and removing of assertions.
I was thinking a rule that requires that assertion for every test would be nice. There is also expect.hasAssertions()
, maybe that should be included in a separate rule? Or maybe not at all, I’ve never used it because it seems better to specify the count of assertions.
If you guys think this sounds good I would like to give a try at implementing it.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Configuring result count assertions - Pega Community
To add a new assertion, click Add expected result. Modify an existing assertion on the tab. From the Assertion type list, select Result...
Read more >SonarQube issue "Add at least one assertion to this test case ...
This is a known limitation of the rule and we will deal with it only when we will be able to efficiently perform...
Read more >Customize SAML Assertions - Auth0
Describes how to customize SAML assertions and the SAML and WS-Fed ... You can use rules to add more extensive or dynamic customizations...
Read more >Working With Assertions in Functional Tests | ReadyAPI ...
Double-click the test step in the Navigator to open its editor. Run the request you are planning to assert at least once to...
Read more >Assertion Configuration at the Asserting Party - TechDocs
Attributes statements are not required in an assertion. You can configure different types of attributes for an attribute statement. The types of ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Go for it, I was going to take a crack at it but things got busy this weekend. I’ll be looking forward to it.
On Sat, Dec 30, 2017, 21:58 tushardhole notifications@github.com wrote:
Docs released in 21.6.1