T-29: lint:check fails on existing issues, so bun run check (M0 exit criterion 1) can't go green
This commit is contained in:
parent
88023ba643
commit
1720e45f70
5 changed files with 43 additions and 31 deletions
4
libs/core/cache/test/redis-cache.test.ts
vendored
4
libs/core/cache/test/redis-cache.test.ts
vendored
|
|
@ -42,7 +42,9 @@ describe.skipIf(!testRedisUrl)('RedisCache', () => {
|
|||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (!cache) return;
|
||||
if (!cache) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await cache.clear();
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ import { Shutdown } from '../src/shutdown';
|
|||
|
||||
// These tests use the real `process` listener registry (no stubs) because the
|
||||
// regression being guarded is listeners leaking across test files in one bun process.
|
||||
const SIGNALS = ['SIGTERM', 'SIGINT'] as const;
|
||||
type TrackedSignal = 'SIGTERM' | 'SIGINT';
|
||||
|
||||
function listenerCounts(): Record<(typeof SIGNALS)[number], number> {
|
||||
function listenerCounts(): Record<TrackedSignal, number> {
|
||||
return {
|
||||
SIGTERM: process.listenerCount('SIGTERM'),
|
||||
SIGINT: process.listenerCount('SIGINT'),
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ export class MongoDBClient {
|
|||
|
||||
cursor.next().then(
|
||||
doc => {
|
||||
if (doc == null) {
|
||||
if (doc === null || doc === undefined) {
|
||||
readInProgress = false;
|
||||
closeCursor().then(
|
||||
() => {
|
||||
|
|
@ -279,7 +279,7 @@ export class MongoDBClient {
|
|||
this.destroy(err instanceof Error ? err : new Error(String(err)));
|
||||
return;
|
||||
}
|
||||
if (output == null) {
|
||||
if (output === null || output === undefined) {
|
||||
readNext();
|
||||
return;
|
||||
}
|
||||
|
|
@ -542,10 +542,10 @@ export class MongoDBClient {
|
|||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('Cursor does not implement "map"');
|
||||
}
|
||||
let receiver: unknown;
|
||||
const receiverRef: { current: unknown } = { current: undefined };
|
||||
const guardedTransform =
|
||||
typeof transform === 'function'
|
||||
? (doc: unknown) => transform.call(receiver, doc)
|
||||
? (doc: unknown) => transform.call(receiverRef.current, doc)
|
||||
: transform;
|
||||
const mapped = fn.call(cursor, guardedTransform);
|
||||
const result =
|
||||
|
|
@ -554,7 +554,7 @@ export class MongoDBClient {
|
|||
: mapped && typeof mapped === 'object'
|
||||
? this.wrapReadOnlyCursor(mapped as object)
|
||||
: mapped;
|
||||
receiver = result;
|
||||
receiverRef.current = result;
|
||||
return result;
|
||||
},
|
||||
clone: () => {
|
||||
|
|
@ -751,17 +751,17 @@ export class MongoDBClient {
|
|||
return wrapped;
|
||||
},
|
||||
map: <TMapped>(transform: (doc: T) => TMapped) => {
|
||||
let receiver: unknown;
|
||||
const receiverRef: { current: unknown } = { current: undefined };
|
||||
const guardedTransform =
|
||||
typeof transform === 'function'
|
||||
? (doc: T) => transform.call(receiver, doc)
|
||||
? (doc: T) => transform.call(receiverRef.current, doc)
|
||||
: transform;
|
||||
const mapped = cursor.map(guardedTransform);
|
||||
const result =
|
||||
mapped === (cursor as unknown)
|
||||
? wrapped
|
||||
: this.wrapReadOnlyAggregationCursor(mapped as unknown as AggregationCursor<Document>);
|
||||
receiver = result;
|
||||
receiverRef.current = result;
|
||||
return result;
|
||||
},
|
||||
clone: () => this.wrapReadOnlyAggregationCursor(cursor.clone()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue