Skip to content

Commit f7b84e3

Browse files
committed
test
1 parent fe12d3f commit f7b84e3

File tree

1 file changed

+22
-1
lines changed
  • packages/acceptance-tests/pkg-tests-specs/sources/commands

1 file changed

+22
-1
lines changed

packages/acceptance-tests/pkg-tests-specs/sources/commands/dedupe.test.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {tests} from 'pkg-tests-core';
1+
import {ppath, xfs, Filename} from '@yarnpkg/fslib';
2+
import {tests} from 'pkg-tests-core';
23

34
const {setPackageWhitelist} = tests;
45

@@ -83,6 +84,26 @@ describe(`Commands`, () => {
8384
}),
8485
);
8586

87+
it(
88+
`should not throw on resolutions by npm-tag-resolver with __archiveUrl`,
89+
makeTemporaryEnv({
90+
dependencies: {[`no-deps`]: `latest`},
91+
}, async ({path, run, source}) => {
92+
await run(`install`);
93+
await run(`add`, `one-range-dep`);
94+
95+
const lockFilePath = ppath.join(path, Filename.lockfile);
96+
let lockContent = await xfs.readFilePromise(lockFilePath, `utf8`);
97+
98+
lockContent = lockContent.replace(`"no-deps@npm:2.0.0"`, `"no-deps@npm:2.0.0::__archiveUrl=https%3A%2F%2Fregistry.com%2Fno-deps-2.0.0.tgz"`);
99+
await xfs.writeFilePromise(lockFilePath, lockContent);
100+
101+
await expect(run(`dedupe`, `--check`)).resolves.toMatchObject({
102+
code: 0,
103+
});
104+
}),
105+
);
106+
86107
it(
87108
`should handle aliased packages`,
88109
makeTemporaryEnv({

0 commit comments

Comments
 (0)