Refactor this code to not nest functions more than 4 levels deep
In such test suites, functions are a way to group tests and don’t add to the complexity of the file. I would advocate for deactivating this rule in such files or raising the limit.
We’re running into typescript:S2004 in tests as well, on Sonar Qube Server Data Centre Edition v2025.2 (105476). In a parametrised test, you trigger this very easily. We don’t want to disable the rule, as it is relevant in non-test code. Current company example project excludes all typescript tests from sonar, and this is one of the major reasons.
We’re using jest, it also uses describe, it and expect. There is also a parametrised test syntax with it.eachGlobals · Jest