testdouble / quibble

Makes it easy to replace require'd dependencies.
94 stars 25 forks source link

Fix resolve behavior when extensions differ #18

Closed searls closed 6 years ago

searls commented 6 years ago

WIP. Fixes #16

These changes should result in a minor performance hit for existing uses of quibble (there are n more resolve() calls each time a stubbing is set up). New tests going forward that take advantage of this flexibility (like the one given in #16) will also rack up an additional resolve() call per require of a stubbed path, which could potentially really add up over the course of a test suite.

In the end, I think correctness is more important than speed in this case. Eager for faster alternatives that would still be as correct.