diff --git a/tests/main.test.ts b/tests/main.test.ts index 71e0b4d..f07cb85 100644 --- a/tests/main.test.ts +++ b/tests/main.test.ts @@ -1,7 +1,6 @@ import {beforeEach, describe, expect, it} from '@jest/globals'; import {Filename, ppath, xfs, npath, PortablePath} from '@yarnpkg/fslib'; import os from 'node:os'; -import path from 'node:path'; import process from 'node:process'; import config from '../config.json'; @@ -421,8 +420,7 @@ it(`should refuse to run a different package manager within a configured project await expect(runCli(cwd, [`pnpm`, `--version`])).resolves.toMatchObject({ stdout: `Usage Error: This project is configured to use yarn because ${ - // ppath and xfs do not format Windows correctly, the regex fixes that: - path.join(cwd.replace(/^\/([a-zA-Z]:)\//, `$1\\`), `package.json`) + npath.fromPortablePath(ppath.join(cwd, `package.json` as Filename)) } has a "packageManager" field\n\n$ pnpm ...\n`, exitCode: 1, });