From 8788874cee7b212ab9b744d922774f14d68fccf4 Mon Sep 17 00:00:00 2001 From: ZhengJin Date: Fri, 1 Nov 2024 22:35:38 +0800 Subject: [PATCH] test: add unit test --- .../package/DownloadPackageVersionTarController.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/port/controller/package/DownloadPackageVersionTarController.test.ts b/test/port/controller/package/DownloadPackageVersionTarController.test.ts index cece06b8..1fd7abb7 100644 --- a/test/port/controller/package/DownloadPackageVersionTarController.test.ts +++ b/test/port/controller/package/DownloadPackageVersionTarController.test.ts @@ -380,7 +380,7 @@ describe('test/port/controller/package/DownloadPackageVersionTarController.test. assert(res.status === 302); assert(res.headers.location === `https://cdn.mock.com/packages/${name}/1.0.0/${name}-1.0.0.tgz`); res = await app.httpRequest() - .get(`/${scopedName}/-/${scope}/${scopedName}-1.0.0.tgz`); + .get(`/${scopedName}/-/${scope}/${name}-1.0.0.tgz`); assert(res.status === 302); assert(res.headers.location === `https://cdn.mock.com/packages/${scopedName}/1.0.0/${name}-1.0.0.tgz`); }); @@ -394,7 +394,7 @@ describe('test/port/controller/package/DownloadPackageVersionTarController.test. assert(res.headers['content-disposition'] === `attachment; filename="${name}-1.0.0.tgz"`); await app.httpRequest() - .get(`/${scopedName}/-/${scope}/${scopedName}-1.0.0.tgz`); + .get(`/${scopedName}/-/${scope}/${name}-1.0.0.tgz`); assert(res.status === 200); assert(res.headers['content-type'] === 'application/octet-stream'); assert(res.headers['content-disposition'] === `attachment; filename="${name}-1.0.0.tgz"`);