Files
pnpm/pnpm11/exec/commands/test/createInstallArgs.test.ts
T
Zoltan Kochan 370dfd4bd0 fix(cli): accept --production, and reproduce a prod install as --prod (#14148)
The Rust CLI registers only `--prod` on `install`, so the `pnpm install …`
command the verify-deps-before-run gate reproduces from a production-only
install — built with pnpm's `--production` spelling — was rejected by the
argument parser, aborting every `pnpm run` (Closes pnpm/pnpm#14147).

`--production` is the setting name behind `--prod`, and the TypeScript CLI
accepts it on every command where `--prod` selects dependency groups, so
restore it as an alias there too (`audit`, `licenses` and `outdated` already
had it), and emit the documented `--prod` in the reproduction command in
both stacks.

Closes #14147
2026-08-25 11:27:03 +02:00

17 lines
659 B
TypeScript

import { describe, expect, test } from '@jest/globals'
import { createInstallArgs } from '../src/runDepsStatusCheck.js'
describe('createInstallArgs', () => {
test.each([
[{ production: true, optional: true }, ['--prod']],
[{ production: true, optional: false }, ['--prod', '--no-optional']],
[{ dev: true, optional: true }, ['--dev']],
[{ dev: true, optional: false }, ['--dev', '--no-optional']],
[{ production: true, dev: true, optional: true }, []],
[{ production: true, dev: true, optional: false }, ['--no-optional']],
])('%o -> %o', (opts, expected) => {
expect(createInstallArgs(opts)).toStrictEqual(expected)
})
})