Skip to content

Commit

Permalink
fix: correct yarn detection (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts authored Aug 25, 2024
1 parent 6e53e9a commit dd76583
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ export const packageManagers: PackageManager[] = [
{
name: "yarn",
command: "yarn",
majorVersion: "1.0.0",
majorVersion: "1",
lockFile: "yarn.lock",
},
{
name: "yarn",
command: "yarn",
majorVersion: "3.0.0",
majorVersion: "3",
lockFile: "yarn.lock",
files: [".yarnrc.yml"],
},
Expand Down
3 changes: 3 additions & 0 deletions test/_shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type Fixture = {
packageManager: PackageManagerName;
majorVersion?: string;
workspace: boolean;
files?: string[];
};

export const fixtures = (
Expand Down Expand Up @@ -48,11 +49,13 @@ export const fixtures = (
name: "yarn-berry",
packageManager: "yarn",
majorVersion: "3",
files: [".yarnrc.yml"],
},
{
name: "yarn-berry-workspace",
packageManager: "yarn",
majorVersion: "3",
files: [".yarnrc.yml"],
},
] satisfies Partial<Fixture>[]
)
Expand Down
3 changes: 3 additions & 0 deletions test/detect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ describe("detectPackageManager", () => {
if (fixture.majorVersion) {
expect(detected?.majorVersion).toBe(fixture.majorVersion);
}
if (fixture.files) {
expect(detected?.files).toEqual(fixture.files);
}
});

it.skipIf(fixture.name.includes("berry") /* TODO */)(
Expand Down

0 comments on commit dd76583

Please sign in to comment.