Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/Disable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
const dontRemoveBin = await makeBin(cwd, `dont-remove` as Filename);
binNames.add(ppath.basename(dontRemoveBin));

process.env.PATH = `${npath.fromPortablePath(cwd)}${delimiter}${process.env.PATH}`;
await expect(runCli(cwd, [`disable`, `yarn`])).resolves.toMatchObject({
await expect(runCli(cwd, [`disable`, `--install-directory=${npath.fromPortablePath(cwd)}`, `yarn`])).resolves.toMatchObject({
exitCode: 0,
});

Expand All @@ -103,12 +102,14 @@
await xfs.mkdirPromise(ppath.join(cwd, `switch/bin`), {recursive: true});
await xfs.writeFilePromise(ppath.join(cwd, `switch/bin/yarn`), `hello`);

await xfs.linkPromise(
await xfs.symlinkPromise(
ppath.join(cwd, `switch/bin/yarn`),
ppath.join(cwd, `yarn`),
);

await expect(runCli(cwd, [`disable`])).resolves.toMatchObject({
await expect(runCli(cwd, [`disable`, `--install-directory=${npath.fromPortablePath(cwd)}`])).resolves.toMatchObject({

Check failure on line 110 in tests/Disable.test.ts

View workflow job for this annotation

GitHub Actions / windows-latest w/ Node.js 20.x

tests/Disable.test.ts > DisableCommand > shouldn't remove Yarn binaries if they are in a /switch/ folder

AssertionError: expected { Object (exitCode, stdout, ...) } to match object { stdout: '', …(2) } - Expected + Received { "exitCode": 0, - "stderr": StringMatching /^yarn is already installed in .+ and points to a Yarn Switch install - skipping\n$/, + "stderr": "", "stdout": "", } ❯ tests/Disable.test.ts:110:7 ❯ NodeFS.mktempPromise .yarn/cache/@yarnpkg-fslib-npm-3.1.4-5a9daa47cb-d38e108a63.zip/node_modules/@yarnpkg/fslib/lib/xfs.js:86:24 ❯ tests/Disable.test.ts:101:5

Check failure on line 110 in tests/Disable.test.ts

View workflow job for this annotation

GitHub Actions / windows-latest w/ Node.js 20.x

tests/Disable.test.ts > DisableCommand > shouldn't remove Yarn binaries if they are in a /switch/ folder

AssertionError: expected { Object (exitCode, stdout, ...) } to match object { stdout: '', …(2) } - Expected + Received { "exitCode": 0, - "stderr": StringMatching /^yarn is already installed in .+ and points to a Yarn Switch install - skipping\n$/, + "stderr": "", "stdout": "", } ❯ tests/Disable.test.ts:110:7 ❯ NodeFS.mktempPromise .yarn/cache/@yarnpkg-fslib-npm-3.1.4-5a9daa47cb-d38e108a63.zip/node_modules/@yarnpkg/fslib/lib/xfs.js:86:24 ❯ tests/Disable.test.ts:101:5

Check failure on line 110 in tests/Disable.test.ts

View workflow job for this annotation

GitHub Actions / windows-latest w/ Node.js 20.x

tests/Disable.test.ts > DisableCommand > shouldn't remove Yarn binaries if they are in a /switch/ folder

AssertionError: expected { Object (exitCode, stdout, ...) } to match object { stdout: '', …(2) } - Expected + Received { "exitCode": 0, - "stderr": StringMatching /^yarn is already installed in .+ and points to a Yarn Switch install - skipping\n$/, + "stderr": "", "stdout": "", } ❯ tests/Disable.test.ts:110:7 ❯ NodeFS.mktempPromise .yarn/cache/@yarnpkg-fslib-npm-3.1.4-5a9daa47cb-d38e108a63.zip/node_modules/@yarnpkg/fslib/lib/xfs.js:86:24 ❯ tests/Disable.test.ts:101:5

Check failure on line 110 in tests/Disable.test.ts

View workflow job for this annotation

GitHub Actions / windows-latest w/ Node.js 22.x

tests/Disable.test.ts > DisableCommand > shouldn't remove Yarn binaries if they are in a /switch/ folder

AssertionError: expected { Object (exitCode, stdout, ...) } to match object { stdout: '', …(2) } - Expected + Received { "exitCode": 0, - "stderr": StringMatching /^yarn is already installed in .+ and points to a Yarn Switch install - skipping\n$/, + "stderr": "", "stdout": "", } ❯ tests/Disable.test.ts:110:7 ❯ NodeFS.mktempPromise .yarn/cache/@yarnpkg-fslib-npm-3.1.4-5a9daa47cb-d38e108a63.zip/node_modules/@yarnpkg/fslib/lib/xfs.js:86:24 ❯ tests/Disable.test.ts:101:5

Check failure on line 110 in tests/Disable.test.ts

View workflow job for this annotation

GitHub Actions / windows-latest w/ Node.js 22.x

tests/Disable.test.ts > DisableCommand > shouldn't remove Yarn binaries if they are in a /switch/ folder

AssertionError: expected { Object (exitCode, stdout, ...) } to match object { stdout: '', …(2) } - Expected + Received { "exitCode": 0, - "stderr": StringMatching /^yarn is already installed in .+ and points to a Yarn Switch install - skipping\n$/, + "stderr": "", "stdout": "", } ❯ tests/Disable.test.ts:110:7 ❯ NodeFS.mktempPromise .yarn/cache/@yarnpkg-fslib-npm-3.1.4-5a9daa47cb-d38e108a63.zip/node_modules/@yarnpkg/fslib/lib/xfs.js:86:24 ❯ tests/Disable.test.ts:101:5

Check failure on line 110 in tests/Disable.test.ts

View workflow job for this annotation

GitHub Actions / windows-latest w/ Node.js 22.x

tests/Disable.test.ts > DisableCommand > shouldn't remove Yarn binaries if they are in a /switch/ folder

AssertionError: expected { Object (exitCode, stdout, ...) } to match object { stdout: '', …(2) } - Expected + Received { "exitCode": 0, - "stderr": StringMatching /^yarn is already installed in .+ and points to a Yarn Switch install - skipping\n$/, + "stderr": "", "stdout": "", } ❯ tests/Disable.test.ts:110:7 ❯ NodeFS.mktempPromise .yarn/cache/@yarnpkg-fslib-npm-3.1.4-5a9daa47cb-d38e108a63.zip/node_modules/@yarnpkg/fslib/lib/xfs.js:86:24 ❯ tests/Disable.test.ts:101:5
stdout: ``,
stderr: expect.stringMatching(/^yarn is already installed in .+ and points to a Yarn Switch install - skipping\n$/),
exitCode: 0,
});

Expand Down
3 changes: 1 addition & 2 deletions tests/Enable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ describe(`EnableCommand`, () => {
await xfs.mktempPromise(async cwd => {
const corepackBin = await makeBin(cwd, `corepack` as Filename);

process.env.PATH = `${npath.fromPortablePath(cwd)}${delimiter}${process.env.PATH}`;
await expect(runCli(cwd, [`enable`, `yarn`])).resolves.toMatchObject({
await expect(runCli(cwd, [`enable`, `--install-directory=${npath.fromPortablePath(cwd)}`, `yarn`])).resolves.toMatchObject({
stdout: ``,
stderr: ``,
exitCode: 0,
Expand Down
Loading