如何使用流程来配置ServiceWorker?

时间:2017-05-23 08:46:51

标签: javascript service-worker flowtype

我试图通过流程获得100%的代码覆盖率,但我仍然坚持使用我的ServiceWorker。它不会抛出任何错误,但所有db.collection.aggregate([ {group: {_id: "$name", school: {$addToSet: {"$school.name"}}}} ]) 都标记为未覆盖。例如:

self.addEventListener(...)

即使我执行self.addEventListener("install", (event) => { console.log("Event: Install"); event.waitUntil( //Open the cache caches .open(cacheName) .then((cache) => { //Adding the files to cache return cache.addAll(filesToCache).then(() => { console.log("All files are cached."); return self.skipWaiting(); //To forces the waiting service worker to become the active service worker }); }) .catch((err) => { console.log(err); }) ); }); 之类的操作,流程也会将此行显示为未覆盖。

我尝试将let a = self更改为self,但这并没有帮助:(

有没有人知道如何解决这个问题?

0 个答案:

没有答案