0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

chore(api): fix void return for some tests (#4969)

This commit is contained in:
Marc Bernard 2024-11-29 18:23:47 -05:00 committed by GitHub
parent 64a7fc0fc7
commit 6e344d0f48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 5 deletions

View file

@ -0,0 +1,5 @@
---
'@verdaccio/api': patch
---
chore(api): fix void return for some tests

View file

@ -31,12 +31,13 @@ describe('package', () => {
['@scope/foo2', 'foo2-1.0.0.tgz'],
])('should fails if tarball does not exist', async (pkg, fileName) => {
await publishVersion(app, pkg, '1.0.1');
return await supertest(app)
await supertest(app)
.get(`/${pkg}/-/${fileName}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.OCTET_STREAM)
.expect(HTTP_STATUS.NOT_FOUND);
});
test.todo('check content length file header');
test.todo('fails on file was aborted');
});

View file

@ -57,7 +57,7 @@ describe('publish', () => {
async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, pkgName, '1.0.0');
return new Promise((resolve) => {
new Promise((resolve) => {
publishVersion(app, pkgName, '1.0.0')
.expect(HTTP_STATUS.CONFLICT)
.then((response) => {
@ -73,7 +73,7 @@ describe('publish', () => {
describe('no proxies setup', () => {
test.each([['foo', '@scope/foo']])('should publish a package', async (pkgName) => {
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
new Promise((resolve) => {
publishVersion(app, pkgName, '1.0.0')
.expect(HTTP_STATUS.CREATED)
.then((response) => {
@ -86,7 +86,7 @@ describe('publish', () => {
test.each([['foo', '@scope/foo']])('should publish a new package', async (pkgName) => {
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)

View file

@ -65,7 +65,7 @@ describe('star', () => {
const app = await initializeServer('star.yaml');
const token = await getNewToken(app, { name: userLogged, password: 'secretPass' });
await publishVersion(app, pkgName, '1.0.0', undefined, token).expect(HTTP_STATUS.CREATED);
return supertest(app)
await supertest(app)
.get(`/-/_view/starredByUser?key_xxxxx=other`)
.set('Accept', HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)