Skip to content

Commit

Permalink
test: add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
fangzhengjin authored Nov 1, 2024
1 parent 88b4f78 commit 8788874
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
});
Expand All @@ -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"`);
Expand Down

0 comments on commit 8788874

Please sign in to comment.