It would be nice to have a lint rule that enforced a length check or use of expect.assertions when an expect call is found inside a loop.
for example:
for(let thing in things) {
expect(thing).toBe("2");
}
would report an error
but this would not:
expect.assertions(4);
for(let thing in things) {
expect(thing).toBe("2");
}
nor would this:
expect(things).toHaveLength(4);
for(let thing in things) {
expect(thing).toBe("2");
}
Main goal here is to prevent false positive tests if things is an empty list.