Financial-Times / n-service-worker

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

Refactor tests #143

Closed alexflorisca closed 6 years ago

alexflorisca commented 6 years ago

Refactored the cache tests to use service-worker-mock.

Main.spec.js and cache.spec.js both touch a lot of browser APIs so have left running on Karma in the browser. Put these in /integration folder as they are more end to end (service worker is loaded in the browser, and checks are done on browser obejcts)

Eventually I'd like to simplify and convert cache.spec.js and main.spec.js to unit tests as well and add a nightwatch test to have a proper integration test, where we can load the service worker, navigate to a new page, and check the caches.