Closed
Description
Suggestion
If you throw an exception in a rule (within the RuleListener object handlers, not at the top level of the create()
function), the whole test suite fails with an unhelpful error message, rather than failing just the individual test run and printing a useful error message. For instance, here's what happens when I throw an exception in a line affected by just one test case:
FAIL tests/rules/no-unnecessary-type-arguments.test.ts
● Test suite failed to run
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'params' -> object with constructor 'Array'
| index 0 -> object with constructor 'Object'
--- property 'parent' closes the circle
at stringify (<anonymous>)
@JoshuaKGoldberg has a hacky workaround. Feel free to share in case that makes it easier to pinpoint the root cause?