Repository navigation
test: reuse the shared sql helper in backup listing tests - #11
Merged
Merged
Conversation
Что: - Тест listBackupFiles в __test__/backup/restore-security.test.ts теперь берёт POSTGRES_MAX_FUNCTION_ARGS, maxJsonBuildArrayArgs и relationalQueryDb из общего __test__/helpers/postgres-function-args.ts. Локальная копия счётчика и создание drizzle.mock в тесте удалены. Зачем: - Счётчик аргументов json_build_array был в двух копиях: в этом тесте и в общем хелпере. Общий заодно пропускает строки в одинарных кавычках. Риски: - Не выявлены, меняется только тест. Проверки: - Команды и результаты: CI=true bunx vitest run --config __test__/vitest.config.ts __test__/backup/restore-security.test.ts - 40 тестов прошли; если в роутере временно вернуть application: true, тест падает с "expected 101 to be less than or equal to 100" (роутер возвращён). bun run typecheck - 4/4 без ошибок. bunx biome check для изменённого файла - 0 ошибок. - Ограничения: не выявлены. What: - The listBackupFiles test in __test__/backup/restore-security.test.ts now takes POSTGRES_MAX_FUNCTION_ARGS, maxJsonBuildArrayArgs and relationalQueryDb from the shared __test__/helpers/postgres-function-args.ts. The local counter copy and the drizzle.mock setup in the test are removed. Why: - The json_build_array argument counter existed twice: in this test and in the shared helper. The shared one also skips single-quoted strings. Risks: - None identified; only the test changes. Checks: - Commands and results: CI=true bunx vitest run --config __test__/vitest.config.ts __test__/backup/restore-security.test.ts - 40 tests passed; with application: true temporarily restored in the router, the test fails with "expected 101 to be less than or equal to 100" (the router was put back). bun run typecheck - 4/4 clean. bunx biome check on the changed file - 0 errors. - Limitations: none identified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
Test-only cleanup. The
listBackupFilesargument-limit test in__test__/backup/restore-security.test.ts(#6) kept its own copy of thejson_build_arrayargument counter. #7 added the same counter as a shared helper,__test__/helpers/postgres-function-args.ts. The test now importsPOSTGRES_MAX_FUNCTION_ARGS,maxJsonBuildArrayArgsandrelationalQueryDbfrom there; the local copy and the localdrizzle.mocksetup are removed.Checks
__test__/backup/restore-security.test.ts: 40 tests pass.application: truetemporarily put back in the backup router, it fails with "expected 101 to be less than or equal to 100".bun run typecheck: 4/4 packages pass.No runtime code changes.
🤖 Generated with Claude Code