Skip to content

Commit bc08ee3

Browse files
committed
feat: when strict checking is off, treat like transparent
1 parent 0b7abb9 commit bc08ee3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

sources/specUtils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export async function findProjectSpec(initialCwd: string, locator: Locator, {tra
4444
// A locator is a valid descriptor (but not the other way around)
4545
const fallbackLocator = {name: locator.name, range: locator.reference};
4646

47-
if (process.env.COREPACK_ENABLE_STRICT === `0`) return fallbackLocator;
47+
if (process.env.COREPACK_ENABLE_STRICT === `0`)
48+
transparent = true;
4849

4950
while (true) {
5051
const result = await loadSpec(initialCwd);

tests/main.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,14 @@ it(`should refuse to run a different package manager within a configured project
270270
process.env.COREPACK_ENABLE_STRICT = `0`;
271271

272272
try {
273+
await expect(runCli(cwd, [`yarn`, `--version`])).resolves.toMatchObject({
274+
stdout: `1.0.0\n`,
275+
stderr: ``,
276+
exitCode: 0,
277+
});
273278
await expect(runCli(cwd, [`pnpm`, `--version`])).resolves.toMatchObject({
274279
stdout: `${config.definitions.pnpm.default.split(`+`, 1)[0]}\n`,
280+
stderr: ``,
275281
exitCode: 0,
276282
});
277283
} finally {

0 commit comments

Comments
 (0)