Skip to content

Commit

Permalink
#42 - Code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kristianbinau committed Oct 22, 2023
1 parent 2a42f7c commit dff6f72
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/modules/item/blob/blob.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default class BlobService {
try {
blob = await this.getByItemId(itemId);
} catch (e) {
/* istanbul ignore next */
return;
}

Expand All @@ -129,7 +130,8 @@ export default class BlobService {
},
}),
ItemService.invalidateCachesForItem(blob),
async () => {
(async () => {
/* istanbul ignore next */
if (!blob.blobUrl) {
return;
}
Expand All @@ -139,7 +141,7 @@ export default class BlobService {
} catch (e) {
// Do nothing
}
},
})(),
]);
}

Expand Down
1 change: 1 addition & 0 deletions src/modules/item/docs/docs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default class DocsService {
try {
docs = await this.getByItemId(itemId);
} catch (e) {
/* istanbul ignore next */
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/modules/item/folder/folder.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default class FolderService {
try {
folder = await this.getByItemId(itemId);
} catch (e) {
/* istanbul ignore next */
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/modules/item/shortcut/shortcut.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default class ShortcutService {
try {
shortcut = await this.getByItemId(itemId);
} catch (e) {
/* istanbul ignore next */
return;
}

Expand Down
5 changes: 4 additions & 1 deletion src/plugins/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export default fastifyPlugin(
if (key.includes('*')) {
// Get all keys matching pattern
keys = await redis.keys(
`${redis.options.keyPrefix ? redis.options.keyPrefix : ''}${key}`,
`${
redis.options.keyPrefix ? redis.options.keyPrefix : /* istanbul ignore next */ ''
}${key}`,
);

await Promise.all(
Expand All @@ -84,6 +86,7 @@ export default fastifyPlugin(
return;
}

/* istanbul ignore next */
await redis.del(key);
}),
);
Expand Down

0 comments on commit dff6f72

Please sign in to comment.