diff --git a/src/package-manager.ts b/src/package-manager.ts index 743d4f2..6b6dfcd 100644 --- a/src/package-manager.ts +++ b/src/package-manager.ts @@ -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"], }, diff --git a/test/_shared.ts b/test/_shared.ts index 57a07e4..a11d182 100644 --- a/test/_shared.ts +++ b/test/_shared.ts @@ -8,6 +8,7 @@ export type Fixture = { packageManager: PackageManagerName; majorVersion?: string; workspace: boolean; + files?: string[]; }; export const fixtures = ( @@ -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[] ) diff --git a/test/detect.test.ts b/test/detect.test.ts index f66d366..43fa1f6 100644 --- a/test/detect.test.ts +++ b/test/detect.test.ts @@ -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 */)(