Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
message: 'Please pick a preset',
choose: 1
}
)
expectedPrompts.push(
{
message: 'Where do you prefer placing config',
choose: 1 // package.json
},
{
message: 'Save this as a preset',
confirm: false
}
)
if (!loadOptions().packageManager) {
expectedPrompts.push({
message: 'package manager',
choose: 0 // yarn
})
}
}
expectPrompts(expectedPrompts)
const creator = new Creator('test', '/', [].concat(module))
const preset = await creator.promptAndResolvePreset()
if (opts.pluginsOnly) {
delete preset.useConfigFiles
}
expect(preset).toEqual(expectedOptions)
}
exports.getCommand = function (cwd = undefined) {
if (!cwd) {
return loadOptions().packageManager || (hasYarn() ? 'yarn' : hasPnpm3OrLater() ? 'pnpm' : 'npm')
}
return hasProjectYarn(cwd) ? 'yarn' : hasProjectPnpm(cwd) ? 'pnpm' : 'npm'
}