diff --git a/libs/cli/src/generators/healthcheck/generator.spec.ts b/libs/cli/src/generators/healthcheck/generator.spec.ts index b1cb5ff04..a332256e8 100644 --- a/libs/cli/src/generators/healthcheck/generator.spec.ts +++ b/libs/cli/src/generators/healthcheck/generator.spec.ts @@ -1,4 +1,4 @@ -import { readJson, Tree } from '@nx/devkit'; +import { readJson, Tree, writeJson } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { healthcheckGenerator } from './generator'; @@ -8,18 +8,15 @@ describe('healthcheck generator', () => { beforeEach(async () => { tree = createTreeWithEmptyWorkspace(); - tree.write( - 'package.json', - JSON.stringify({ - dependencies: { - '@spartan-ng/brain': '0.0.1-alpha.300', - '@spartan-ng/ui-checkbox-brain': '0.0.1-alpha.300', - }, - devDependencies: { - '@spartan-ng/cli': '0.0.1-alpha.300', - }, - }), - ); + writeJson(tree, 'package.json', { + dependencies: { + '@spartan-ng/brain': '0.0.1-alpha.300', + '@spartan-ng/ui-checkbox-brain': '0.0.1-alpha.300', + }, + devDependencies: { + '@spartan-ng/cli': '0.0.1-alpha.300', + }, + }); // add a file with legacy imports tree.write( diff --git a/libs/cli/src/generators/healthcheck/generator.ts b/libs/cli/src/generators/healthcheck/generator.ts index 778ae1052..b68e40396 100644 --- a/libs/cli/src/generators/healthcheck/generator.ts +++ b/libs/cli/src/generators/healthcheck/generator.ts @@ -36,7 +36,7 @@ export async function healthcheckGenerator(tree: Tree, options: HealthcheckGener // if there are some failed healthchecks that can be fixed, ask the user if they want to fix them for (const report of failedReports) { if (report.fixable && isHealthcheckFixable(report.healthcheck)) { - const fix = options.autoFix ?? (await promptUser(report.healthcheck.prompt)); + const fix = options.autoFix || (await promptUser(report.healthcheck.prompt)); if (fix) { await report.healthcheck.fix(tree);