djezzzl / factory_trace

Simple tool to maintain factories and traits from FactoryBot
MIT License
386 stars 7 forks source link

Adds guard clauses to FindUnused #19

Closed stevendaniels closed 3 years ago

stevendaniels commented 4 years ago

When working with this library with minitest, I encountered situations where a factory would return nil. These nil checks prevented FactoryTrace from throwing errors before finishing.

djezzzl commented 4 years ago

Hey @stevendaniels, first of all, thank you for using the gem and contributing to it!

What I see you're trying to avoid, was happening to me a couple of times too but I believe it's not the "real" fix.

It shouldn't be the case, when there were a factory or trait when we gathered statistics but when we tried to mark, we weren't able to locate it.

Could you please gather the trace for me and I'll try to debug what's happening and why? You can do that with this command: FB_TRACE=trace_only FB_TRACE_FILE=fb_trace_result.json bundle exec rspec