I Want to know if there is library specific to unit test the service-worker.Or if there is any way to mock the install and other events to check wheather it's working as expected.
2 Answers
You should have googled first, right? :-)
Read this excellent article by Matt Gaunt of Google and check out how one of the bigger Service Worker libraries, SW Toolbox implements their library testing over here.
2 Comments
Gaurav Sharma
Thanks, btw I checked this article before posting this question, but my aim is to get more recommendation on it
pate
Ha! Ok! I suppose next time you should tell that in your question :-)
You can use a package service-worker-mock. service-worker-mock
I believe this material would be a great reference point Service Worker Testing Made Easy