From 3f8c69c0aa8528431564b45ae7c4efb9901ab36f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Aug 2026 09:09:38 +0300 Subject: [PATCH] fix(test): repair the unterminated string in the cover upload suite #216 merged while its CI was red, so main carries a test file that cannot be parsed: the multipart helper has literal newlines where CRLF escapes belong, which leaves Buffer.from("") as an unterminated string. vitest collects zero tests from the file and reports the suite as failing, so the E2E job on main is currently red. This is the fix that was already on the PR branch but had not reached the PR when it was merged. Verified two ways before pushing, since none of the local checks cover test files - build type-checks tsconfig.build.json which excludes tests/, test:unit does not run e2e, and eslint ignores tests/**: tsc -p tsconfig.json --noEmit no errors for this file esbuild exits 0, both new test names in the output Co-Authored-By: Claude Opus 5 --- tests/e2e/article/upload-cover.test.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/e2e/article/upload-cover.test.ts b/tests/e2e/article/upload-cover.test.ts index 73b5f12..9e95891 100644 --- a/tests/e2e/article/upload-cover.test.ts +++ b/tests/e2e/article/upload-cover.test.ts @@ -48,22 +48,16 @@ function multipartMany(count: number): Buffer { for (let i = 0; i < count; i++) { parts.push( Buffer.from( - `--${BOUNDARY} -` + - `Content-Disposition: form-data; name="file"; filename="cover${i}.png" -` + - `Content-Type: image/png - -`, + `--${BOUNDARY}\r\n` + + `Content-Disposition: form-data; name="file"; filename="cover${i}.png"\r\n` + + `Content-Type: image/png\r\n\r\n`, ), Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, i]), - Buffer.from(" -"), + Buffer.from("\r\n"), ); } - parts.push(Buffer.from(`--${BOUNDARY}-- -`)); + parts.push(Buffer.from(`--${BOUNDARY}--\r\n`)); return Buffer.concat(parts); }