From bed8bb9ff05d40ede4ef59868cac444d741b5aba Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Fri, 26 Apr 2024 23:15:37 +0200 Subject: [PATCH] feat: setting virtual store dir length --- reviewing/plugin-commands-listing/test/index.ts | 8 ++++++++ reviewing/plugin-commands-listing/test/why.ts | 2 ++ 2 files changed, 10 insertions(+) diff --git a/reviewing/plugin-commands-listing/test/index.ts b/reviewing/plugin-commands-listing/test/index.ts index fdf248bc3aa..babf699621b 100644 --- a/reviewing/plugin-commands-listing/test/index.ts +++ b/reviewing/plugin-commands-listing/test/index.ts @@ -28,6 +28,7 @@ test('listing packages', async () => { dev: false, dir: process.cwd(), optional: false, + virtualStoreDirMaxLength: 120, }, []) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only @@ -43,6 +44,7 @@ is-positive 1.0.0`) dir: process.cwd(), optional: false, production: false, + virtualStoreDirMaxLength: 120, }, []) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only @@ -56,6 +58,7 @@ is-negative 1.0.0`) { const output = await list.handler({ dir: process.cwd(), + virtualStoreDirMaxLength: 120, }, []) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only @@ -92,6 +95,7 @@ test(`listing packages of a project that has an external ${WANTED_LOCKFILE}`, as const output = await list.handler({ dir: process.cwd(), lockfileDir: path.resolve('..'), + virtualStoreDirMaxLength: 120, }, []) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only @@ -113,6 +117,7 @@ test.skip('list on a project with skipped optional dependencies', async () => { const output = await list.handler({ depth: 10, dir: process.cwd(), + virtualStoreDirMaxLength: 120, }, []) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only @@ -129,6 +134,7 @@ pkg-with-optional 1.0.0 const output = await list.handler({ depth: 10, dir: process.cwd(), + virtualStoreDirMaxLength: 120, }, ['not-compatible-with-any-os']) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only @@ -143,6 +149,7 @@ pkg-with-optional 1.0.0 { const output = await why.handler({ dir: process.cwd(), + virtualStoreDirMaxLength: 120, }, ['not-compatible-with-any-os']) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only @@ -179,6 +186,7 @@ test('listing packages should not fail on package that has local file directory dev: false, dir: pkgDir, optional: false, + virtualStoreDirMaxLength: 120, }, []) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only diff --git a/reviewing/plugin-commands-listing/test/why.ts b/reviewing/plugin-commands-listing/test/why.ts index 8f51d083c74..82b2f1eabee 100644 --- a/reviewing/plugin-commands-listing/test/why.ts +++ b/reviewing/plugin-commands-listing/test/why.ts @@ -15,6 +15,7 @@ test('`pnpm why` should fail if no package name was provided', async () => { try { await why.handler({ dir: process.cwd(), + virtualStoreDirMaxLength: 120, }, []) } catch (_err: any) { // eslint-disable-line err = _err @@ -38,6 +39,7 @@ test('"why" should find non-direct dependency', async () => { dev: false, dir: process.cwd(), optional: false, + virtualStoreDirMaxLength: 120, }, ['@pnpm.e2e/dep-of-pkg-with-1-dep']) expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only