szmarczak / cacheable-lookup

A cacheable dns.lookup(…) that respects TTL :tada:
MIT License
193 stars 29 forks source link

Fix incompatibility with Electron renderer process #22

Closed kaatt closed 4 years ago

kaatt commented 4 years ago

Fixes #21

Would be a good idea to add a test for this.

Not sure why tests are failing.

szmarczak commented 4 years ago

Not sure why tests are failing.

https://github.com/szmarczak/cacheable-lookup/blob/6c5f5d5eed568240ac5b6febe913d5befd8bf5f3/tests/test.js#L762-L782

Since you're declaring setTimeout, it's no longer a global. So the solution is to use proxyquire in this test. I will the test this ASAP.

szmarczak commented 4 years ago

Released 4.2.3