我试图通过流程获得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
,但这并没有帮助:(
有没有人知道如何解决这个问题?