Skip to content

Commit a0a55cb

Browse files
authored
Fixes the /<name>/<version> format (#6993)
## What's the problem this PR addresses? The test framework was using the wrong format for the `/<name>/<version>` endpoint from the npm registry: https://registry.npmjs.org/lodash/1.0.0 The value shouldn't be wrapped in a dictionary. ## How did you fix it? Remove the extra wrapper. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed.
1 parent 21eaf64 commit a0a55cb

File tree

1 file changed

+8
-10
lines changed
  • packages/acceptance-tests/pkg-tests-core/sources/utils

1 file changed

+8
-10
lines changed

packages/acceptance-tests/pkg-tests-core/sources/utils/tests.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -479,16 +479,14 @@ export const startPackageServer = ({type}: {type: keyof typeof packageServerUrls
479479
const packageVersionEntry = packageEntry.get(version);
480480
invariant(packageVersionEntry, `This can only exist`);
481481

482-
const data = JSON.stringify({
483-
[version as string]: Object.assign({}, packageVersionEntry!.packageJson, {
484-
dist: {
485-
shasum: await getPackageArchiveHash(name, version),
486-
tarball: (localName === `unconventional-tarball` || localName === `private-unconventional-tarball`)
487-
? (await getPackageHttpArchivePath(name, version)).replace(`/-/`, `/tralala/`)
488-
: await getPackageHttpArchivePath(name, version),
489-
},
490-
}),
491-
});
482+
const data = JSON.stringify(Object.assign({}, packageVersionEntry!.packageJson, {
483+
dist: {
484+
shasum: await getPackageArchiveHash(name, version),
485+
tarball: (localName === `unconventional-tarball` || localName === `private-unconventional-tarball`)
486+
? (await getPackageHttpArchivePath(name, version)).replace(`/-/`, `/tralala/`)
487+
: await getPackageHttpArchivePath(name, version),
488+
},
489+
}));
492490

493491
response.writeHead(200, {[`Content-Type`]: `application/json`});
494492
response.end(data);

0 commit comments

Comments
 (0)