graycoreio / daffodil

Angular Ecommerce PWA Framework
https://next.daff.io
MIT License
157 stars 31 forks source link

[FEAT] Linting rules for describe() depth in tests #122

Open damienwebdev opened 6 years ago

damienwebdev commented 6 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

Currently, tests don't follow well defined patterns or style guides.

Expected behavior

That tests follow well designed patterns and style guides.

What is the motivation / use case for changing the behavior?

As a start, in addition to the Angular styleguide rules, it would be nice if we could enforce a "describe" depth of 3, which would allow us to do meta-analysis of the complexity of a piece of code.

damienwebdev commented 2 months ago

It looks like eslint supports this for jest. https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/max-nested-describe.md