Skip to content

Commit

Permalink
feat: setting virtual store dir length
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Apr 26, 2024
1 parent 40e950b commit bed8bb9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions reviewing/plugin-commands-listing/test/index.ts
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reviewing/plugin-commands-listing/test/why.ts
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bed8bb9

Please sign in to comment.