Financial-Times / n-service-worker

❌ DECOMMISSIONED Global service worker component for next.ft.com
5 stars 2 forks source link

Fix max age test 🐿 v2.12.5 #170

Closed alexflorisca closed 4 years ago

alexflorisca commented 4 years ago

Fixes some of the cache cache invalidation tests. The sw database is accessed async, so testing the expiry of an entry cannot be done accurately. The test was testing the expiry value +/- 500ms to allow for discrepancies in async code execution time. On circle, this was just over the 500ms mark so I've increased this to +/- 1000ms to make sure this doesn't break again, but still accurate enough.