mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 17:21:51 +08:00
refactor: add tmp extract check to avoid issue in unit tests
As `hasYarn` function is called when `npm_init.ts` is parsed and loaded there are some issue with mock in unit tests.
This commit is contained in:
parent
100ffac29c
commit
aa02e872dc
@ -9,7 +9,7 @@ export function hasYarn() {
|
||||
const lockFile = findUp.sync(['yarn.lock', 'package-lock.json']);
|
||||
const hasYarnLock = lockFile && path.basename(lockFile) === 'yarn.lock';
|
||||
|
||||
if (yarnAvailable.status === 0 && (hasYarnLock || npmAvailable.status !== 0)) {
|
||||
if (yarnAvailable && yarnAvailable.status === 0 && (hasYarnLock || npmAvailable.status !== 0)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user