Gaurav Sharma
Gaurav Sharma

Reputation: 421

Unit test service worker

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.

Upvotes: 1

Views: 2329

Answers (2)

ExtremeCode
ExtremeCode

Reputation: 114

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

Upvotes: 2

pate
pate

Reputation: 5263

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.

Upvotes: 2

Related Questions