Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cacheable - upgrading vitest to 2.1.8 #940

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading