Skip to content
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"scripts": {
"test": "pnpm recursive run test",
"test:ci": "c8 --reporter=lcov pnpm recursive run test:ci",
"test:services:start": "docker-compose up -d",
"test:services:stop": "docker-compose down",
"test:services:start": "docker compose up -d",
"test:services:stop": "docker compose down",
"build": "pnpm recursive run build",
"clean": "pnpm recursive run clean"
},
Expand Down
20 changes: 15 additions & 5 deletions packages/cache-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,30 @@
"@faker-js/faker": "^8.4.1",
"@types/lodash.clonedeep": "^4.5.9",
"@types/node": "^20.14.10",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"@vitest/coverage-v8": "^2.0.2",
"eslint-config-xo-typescript": "^4.0.0",
"eslint-config-xo-typescript": "^5.0.0",
"rimraf": "^6.0.1",
"typescript": "^5.5.3",
"vitest": "^2.0.2",
"xo": "^0.58.0"
"xo": "^0.59.2"
},
"xo": {
"extends": "xo-typescript",
"extensions": [
"ts",
"tsx"
]
],
"rules": {
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
"promise/prefer-await-to-then": "off",
"no-promise-executor-return promise/param-names": "off",
"promise/param-names": "off",
"no-promise-executor-return": "off",
"@typescript-eslint/only-throw-error": "off",
"promise/valid-params": "off",
"n/file-extension-in-import": "off"
}
}
}
1 change: 0 additions & 1 deletion packages/cache-manager/src/caching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ export function createCache<S extends Store, C extends Config>(
if (arguments_?.onBackgroundRefreshError) {
arguments_.onBackgroundRefreshError(error);
} else {
// eslint-disable-next-line @typescript-eslint/no-throw-literal
throw error;
}
});
Expand Down
9 changes: 4 additions & 5 deletions packages/cache-manager/test/caching.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/* eslint-disable max-nested-callbacks */
import {afterEach} from 'node:test';
import process from 'node:process';
import {faker} from '@faker-js/faker';
import type promiseCoalesce from 'promise-coalesce';
import {
beforeEach, describe, expect, it, vi,
beforeEach, afterEach, describe, expect, it, vi,
} from 'vitest';
import {
caching, type Cache, type MemoryConfig, memoryStore, createCache, type Store,
} from '../src/index.js';
import {sleep, disableExistingExceptionListeners} from './utils.js';
} from '../src/index.ts';
import {sleep, disableExistingExceptionListeners} from './utils.ts';

// Allow the module to be mocked so we can assert
// the old and new behavior for issue #417
Expand Down Expand Up @@ -474,7 +473,7 @@ describe('caching', () => {
const resolveAfter
= (timeout: number, value: number) => async (): Promise<number> =>
new Promise(resolve =>
// eslint-disable-next-line no-promise-executor-return

setTimeout(() => {
callCount++;
resolve(value);
Expand Down
4 changes: 2 additions & 2 deletions packages/cache-manager/test/multi-caching.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {faker} from '@faker-js/faker';
import EventEmitter from 'eventemitter3';
import {
type Cache, caching, type MemoryCache, type MultiCache, multiCaching, type Store,
} from '../src/index.js';
import {sleep} from './utils.js';
} from '../src/index.ts';
import {sleep} from './utils.ts';

describe('multiCaching', () => {
let memoryCache: MemoryCache;
Expand Down
4 changes: 2 additions & 2 deletions packages/cache-manager/test/stores/memory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
import {faker} from '@faker-js/faker';
import {
caching, type MemoryCache, type MemoryStore, memoryStore,
} from '../../src/index.js';
import {sleep} from '../utils.js';
} from '../../src/index.ts';
import {sleep} from '../utils.ts';

describe('memory store', () => {
describe('instantiating', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cache-manager/test/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
describe, vi, it, expect,
} from 'vitest';
import {conditionalAwait} from '../src/utils.js';
import {conditionalAwait} from '../src/utils.ts';

describe('utils', () => {
describe('conditionalAwait', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/cache-manager/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import process from 'node:process';

// eslint-disable-next-line no-promise-executor-return
export const sleep = async (ms: number) => new Promise(r => setTimeout(r, ms));

export const disableExistingExceptionListeners = () => {
Expand Down