Skip to content

Commit

Permalink
cacheable - upgrading vitest to 2.1.8 (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwray authored Dec 12, 2024
1 parent f93f5f8 commit de2b78f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/cacheable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
"devDependencies": {
"@keyv/redis": "^4.0.2",
"@types/node": "^22.10.2",
"@vitest/coverage-v8": "^2.1.4",
"@vitest/coverage-v8": "^2.1.8",
"lru-cache": "^11.0.2",
"rimraf": "^6.0.1",
"tsup": "^8.3.5",
"typescript": "^5.7.2",
"vitest": "^2.1.4",
"vitest": "^2.1.8",
"xo": "^0.60.0"
},
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions packages/cacheable/src/coalesce-async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function addCallbackToKey<T>(key: string, callback: PromiseCallback<T>): void {
}

function getCallbacksByKey<T>(key: string): Array<PromiseCallback<T>> {
/* c8 ignore next 1 */
return callbacks.get(key) ?? [];
}

Expand All @@ -44,6 +45,7 @@ function coalesce<T>(options: {key: string; error?: Error; result?: T}): void {
const {key, error, result} = options;

for (const callback of dequeue(key)) {
/* c8 ignore next 1 */
if (error) {
/* c8 ignore next 3 */
callback.reject(error);
Expand Down Expand Up @@ -80,6 +82,7 @@ export async function coalesceAsync<T>(
const result = await Promise.resolve(fnc());
coalesce({key, result});
return result;
/* c8 ignore next 1 */
} catch (error: any) {
/* c8 ignore next 5 */
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
Expand Down
2 changes: 1 addition & 1 deletion packages/cacheable/src/memory-lru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export class DoublyLinkedList<T> {
if (this.tail.prev) {
this.tail = this.tail.prev;
this.tail.next = undefined;
/* c8 ignore next 4 */
} else {
/* c8 ignore next 3 */
// eslint-disable-next-line no-multi-assign
this.head = this.tail = undefined;
}
Expand Down
1 change: 1 addition & 0 deletions packages/cacheable/src/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ export class CacheableMemory extends Hookified {
*/
public startIntervalCheck() {
if (this._checkInterval > 0) {
/* c8 ignore next 1 */
if (this._interval) {
// Be overly cautious and clear the interval as we've unref'd it and we don't want to leak it
/* c8 ignore next 2 */
Expand Down

0 comments on commit de2b78f

Please sign in to comment.