dotenv-diff 2.7.9 → 2.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/src/commands/compare.js +1 -1
- package/dist/src/commands/compare.js.map +1 -1
- package/dist/src/commands/prompts/promptEnsureFiles.d.ts.map +1 -1
- package/dist/src/commands/prompts/promptEnsureFiles.js +10 -5
- package/dist/src/commands/prompts/promptEnsureFiles.js.map +1 -1
- package/dist/src/commands/scanUsage.js +9 -9
- package/dist/src/commands/scanUsage.js.map +1 -1
- package/dist/src/config/types.d.ts +2 -1
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/core/fixEnv.d.ts.map +1 -1
- package/dist/src/core/fixEnv.js +8 -5
- package/dist/src/core/fixEnv.js.map +1 -1
- package/dist/src/core/helpers/isLikelyMinified.d.ts +2 -0
- package/dist/src/core/helpers/isLikelyMinified.d.ts.map +1 -1
- package/dist/src/core/helpers/isLikelyMinified.js +2 -0
- package/dist/src/core/helpers/isLikelyMinified.js.map +1 -1
- package/dist/src/core/scan/patterns.d.ts +9 -1
- package/dist/src/core/scan/patterns.d.ts.map +1 -1
- package/dist/src/core/scan/patterns.js +32 -0
- package/dist/src/core/scan/patterns.js.map +1 -1
- package/dist/src/core/scan/scanFile.d.ts.map +1 -1
- package/dist/src/core/scan/scanFile.js +9 -2
- package/dist/src/core/scan/scanFile.js.map +1 -1
- package/dist/src/core/security/secretDetectors.js +1 -1
- package/dist/src/core/security/secretDetectors.js.map +1 -1
- package/dist/src/services/detectEnvExpirations.js +0 -2
- package/dist/src/services/detectEnvExpirations.js.map +1 -1
- package/dist/src/services/envDiscovery.js +6 -6
- package/dist/src/services/envDiscovery.js.map +1 -1
- package/dist/src/services/processComparisonFile.d.ts +1 -2
- package/dist/src/services/processComparisonFile.d.ts.map +1 -1
- package/dist/test/e2e/cli.autoscan.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.autoscan.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.autoscan.e2e.test.js +263 -0
- package/dist/test/e2e/cli.autoscan.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.compare.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.compare.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.compare.e2e.test.js +94 -0
- package/dist/test/e2e/cli.compare.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.detectExpired.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.detectExpired.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.detectExpired.e2e.test.js +148 -0
- package/dist/test/e2e/cli.detectExpired.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.flags.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.flags.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.flags.e2e.test.js +424 -0
- package/dist/test/e2e/cli.flags.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.healthscore.test.d.ts +2 -0
- package/dist/test/e2e/cli.healthscore.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.healthscore.test.js +79 -0
- package/dist/test/e2e/cli.healthscore.test.js.map +1 -0
- package/dist/test/e2e/cli.ignore.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.ignore.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.ignore.e2e.test.js +88 -0
- package/dist/test/e2e/cli.ignore.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.inconsistentNaming.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.inconsistentNaming.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.inconsistentNaming.e2e.test.js +94 -0
- package/dist/test/e2e/cli.inconsistentNaming.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.jsonOutput.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.jsonOutput.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.jsonOutput.e2e.test.js +39 -0
- package/dist/test/e2e/cli.jsonOutput.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.loggedWarnings.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.loggedWarnings.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.loggedWarnings.e2e.test.js +118 -0
- package/dist/test/e2e/cli.loggedWarnings.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.secrets.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.secrets.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.secrets.e2e.test.js +344 -0
- package/dist/test/e2e/cli.secrets.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.strict.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.strict.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.strict.e2e.test.js +76 -0
- package/dist/test/e2e/cli.strict.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.uppercaseWarnings.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.uppercaseWarnings.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.uppercaseWarnings.e2e.test.js +59 -0
- package/dist/test/e2e/cli.uppercaseWarnings.e2e.test.js.map +1 -0
- package/dist/test/e2e/cli.warningsCount.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli.warningsCount.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli.warningsCount.e2e.test.js +54 -0
- package/dist/test/e2e/cli.warningsCount.e2e.test.js.map +1 -0
- package/dist/test/e2e/frameworks/cli.nextJs.e2e.test.d.ts +2 -0
- package/dist/test/e2e/frameworks/cli.nextJs.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/frameworks/cli.nextJs.e2e.test.js +182 -0
- package/dist/test/e2e/frameworks/cli.nextJs.e2e.test.js.map +1 -0
- package/dist/test/e2e/frameworks/cli.sveltekit.e2e.test.d.ts +2 -0
- package/dist/test/e2e/frameworks/cli.sveltekit.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/frameworks/cli.sveltekit.e2e.test.js +333 -0
- package/dist/test/e2e/frameworks/cli.sveltekit.e2e.test.js.map +1 -0
- package/dist/test/integration/compare-flow.integration.test.d.ts +2 -0
- package/dist/test/integration/compare-flow.integration.test.d.ts.map +1 -0
- package/dist/test/integration/compare-flow.integration.test.js +26 -0
- package/dist/test/integration/compare-flow.integration.test.js.map +1 -0
- package/dist/test/unit/cli/program.test.d.ts +2 -0
- package/dist/test/unit/cli/program.test.d.ts.map +1 -0
- package/dist/test/unit/cli/program.test.js +49 -0
- package/dist/test/unit/cli/program.test.js.map +1 -0
- package/dist/test/unit/cli/run.test.d.ts +2 -0
- package/dist/test/unit/cli/run.test.d.ts.map +1 -0
- package/dist/test/unit/cli/run.test.js +331 -0
- package/dist/test/unit/cli/run.test.js.map +1 -0
- package/dist/test/unit/commands/compare.test.d.ts +2 -0
- package/dist/test/unit/commands/compare.test.d.ts.map +1 -0
- package/dist/test/unit/commands/compare.test.js +664 -0
- package/dist/test/unit/commands/compare.test.js.map +1 -0
- package/dist/test/unit/commands/init.test.d.ts +2 -0
- package/dist/test/unit/commands/init.test.d.ts.map +1 -0
- package/dist/test/unit/commands/init.test.js +54 -0
- package/dist/test/unit/commands/init.test.js.map +1 -0
- package/dist/test/unit/commands/prompts/promptEnsureFiles.test.d.ts +2 -0
- package/dist/test/unit/commands/prompts/promptEnsureFiles.test.d.ts.map +1 -0
- package/dist/test/unit/commands/prompts/promptEnsureFiles.test.js +225 -0
- package/dist/test/unit/commands/prompts/promptEnsureFiles.test.js.map +1 -0
- package/dist/test/unit/commands/prompts/promptNoEnvScenario.test.d.ts +2 -0
- package/dist/test/unit/commands/prompts/promptNoEnvScenario.test.d.ts.map +1 -0
- package/dist/test/unit/commands/prompts/promptNoEnvScenario.test.js +109 -0
- package/dist/test/unit/commands/prompts/promptNoEnvScenario.test.js.map +1 -0
- package/dist/test/unit/commands/prompts/prompts.test.d.ts +2 -0
- package/dist/test/unit/commands/prompts/prompts.test.d.ts.map +1 -0
- package/dist/test/unit/commands/prompts/prompts.test.js +75 -0
- package/dist/test/unit/commands/prompts/prompts.test.js.map +1 -0
- package/dist/test/unit/commands/scanUsage.test.d.ts +2 -0
- package/dist/test/unit/commands/scanUsage.test.d.ts.map +1 -0
- package/dist/test/unit/commands/scanUsage.test.js +639 -0
- package/dist/test/unit/commands/scanUsage.test.js.map +1 -0
- package/dist/test/unit/config/loadConfig.test.d.ts +2 -0
- package/dist/test/unit/config/loadConfig.test.d.ts.map +1 -0
- package/dist/test/unit/config/loadConfig.test.js +106 -0
- package/dist/test/unit/config/loadConfig.test.js.map +1 -0
- package/dist/test/unit/config/options.test.d.ts +2 -0
- package/dist/test/unit/config/options.test.d.ts.map +1 -0
- package/dist/test/unit/config/options.test.js +69 -0
- package/dist/test/unit/config/options.test.js.map +1 -0
- package/dist/test/unit/core/compare/calculateStats.test.d.ts +2 -0
- package/dist/test/unit/core/compare/calculateStats.test.d.ts.map +1 -0
- package/dist/test/unit/core/compare/calculateStats.test.js +33 -0
- package/dist/test/unit/core/compare/calculateStats.test.js.map +1 -0
- package/dist/test/unit/core/compare/parseAndFilterEnv.test.d.ts +2 -0
- package/dist/test/unit/core/compare/parseAndFilterEnv.test.d.ts.map +1 -0
- package/dist/test/unit/core/compare/parseAndFilterEnv.test.js +227 -0
- package/dist/test/unit/core/compare/parseAndFilterEnv.test.js.map +1 -0
- package/dist/test/unit/core/compare/updateTotals.test.d.ts +2 -0
- package/dist/test/unit/core/compare/updateTotals.test.d.ts.map +1 -0
- package/dist/test/unit/core/compare/updateTotals.test.js +106 -0
- package/dist/test/unit/core/compare/updateTotals.test.js.map +1 -0
- package/dist/test/unit/core/detectInconsistentNaming.test.d.ts +2 -0
- package/dist/test/unit/core/detectInconsistentNaming.test.d.ts.map +1 -0
- package/dist/test/unit/core/detectInconsistentNaming.test.js +79 -0
- package/dist/test/unit/core/detectInconsistentNaming.test.js.map +1 -0
- package/dist/test/unit/core/diffEnv.test.d.ts +2 -0
- package/dist/test/unit/core/diffEnv.test.d.ts.map +1 -0
- package/dist/test/unit/core/diffEnv.test.js +74 -0
- package/dist/test/unit/core/diffEnv.test.js.map +1 -0
- package/dist/test/unit/core/duplicates.unit.test.d.ts +2 -0
- package/dist/test/unit/core/duplicates.unit.test.d.ts.map +1 -0
- package/dist/test/unit/core/duplicates.unit.test.js +91 -0
- package/dist/test/unit/core/duplicates.unit.test.js.map +1 -0
- package/dist/test/unit/core/filterIgnoredKeys.test.d.ts +2 -0
- package/dist/test/unit/core/filterIgnoredKeys.test.d.ts.map +1 -0
- package/dist/test/unit/core/filterIgnoredKeys.test.js +61 -0
- package/dist/test/unit/core/filterIgnoredKeys.test.js.map +1 -0
- package/dist/test/unit/core/fixEnv.test.d.ts +2 -0
- package/dist/test/unit/core/fixEnv.test.d.ts.map +1 -0
- package/dist/test/unit/core/fixEnv.test.js +323 -0
- package/dist/test/unit/core/fixEnv.test.js.map +1 -0
- package/dist/test/unit/core/frameworks/frameworkDetector.test.d.ts +2 -0
- package/dist/test/unit/core/frameworks/frameworkDetector.test.d.ts.map +1 -0
- package/dist/test/unit/core/frameworks/frameworkDetector.test.js +44 -0
- package/dist/test/unit/core/frameworks/frameworkDetector.test.js.map +1 -0
- package/dist/test/unit/core/frameworks/frameworkValidator.test.d.ts +2 -0
- package/dist/test/unit/core/frameworks/frameworkValidator.test.d.ts.map +1 -0
- package/dist/test/unit/core/frameworks/frameworkValidator.test.js +51 -0
- package/dist/test/unit/core/frameworks/frameworkValidator.test.js.map +1 -0
- package/dist/test/unit/core/frameworks/nextJsRules.test.d.ts +2 -0
- package/dist/test/unit/core/frameworks/nextJsRules.test.d.ts.map +1 -0
- package/dist/test/unit/core/frameworks/nextJsRules.test.js +97 -0
- package/dist/test/unit/core/frameworks/nextJsRules.test.js.map +1 -0
- package/dist/test/unit/core/frameworks/sveltekitRules.test.d.ts +2 -0
- package/dist/test/unit/core/frameworks/sveltekitRules.test.d.ts.map +1 -0
- package/dist/test/unit/core/frameworks/sveltekitRules.test.js +177 -0
- package/dist/test/unit/core/frameworks/sveltekitRules.test.js.map +1 -0
- package/dist/test/unit/core/helpers/resolveFromCwd.test.d.ts +2 -0
- package/dist/test/unit/core/helpers/resolveFromCwd.test.d.ts.map +1 -0
- package/dist/test/unit/core/helpers/resolveFromCwd.test.js +35 -0
- package/dist/test/unit/core/helpers/resolveFromCwd.test.js.map +1 -0
- package/dist/test/unit/core/helpers/toUpperSnakeCase.test.d.ts +2 -0
- package/dist/test/unit/core/helpers/toUpperSnakeCase.test.d.ts.map +1 -0
- package/dist/test/unit/core/helpers/toUpperSnakeCase.test.js +47 -0
- package/dist/test/unit/core/helpers/toUpperSnakeCase.test.js.map +1 -0
- package/dist/test/unit/core/parseEnv.test.d.ts +2 -0
- package/dist/test/unit/core/parseEnv.test.d.ts.map +1 -0
- package/dist/test/unit/core/parseEnv.test.js +169 -0
- package/dist/test/unit/core/parseEnv.test.js.map +1 -0
- package/dist/test/unit/core/scan/compareScan.test.d.ts +2 -0
- package/dist/test/unit/core/scan/compareScan.test.d.ts.map +1 -0
- package/dist/test/unit/core/scan/compareScan.test.js +40 -0
- package/dist/test/unit/core/scan/compareScan.test.js.map +1 -0
- package/dist/test/unit/core/scan/computeHealthScore.test.d.ts +2 -0
- package/dist/test/unit/core/scan/computeHealthScore.test.d.ts.map +1 -0
- package/dist/test/unit/core/scan/computeHealthScore.test.js +41 -0
- package/dist/test/unit/core/scan/computeHealthScore.test.js.map +1 -0
- package/dist/test/unit/core/scan/determineComparisonFile.test.d.ts +2 -0
- package/dist/test/unit/core/scan/determineComparisonFile.test.d.ts.map +1 -0
- package/dist/test/unit/core/scan/determineComparisonFile.test.js +162 -0
- package/dist/test/unit/core/scan/determineComparisonFile.test.js.map +1 -0
- package/dist/test/unit/core/scan/patterns.test.d.ts +2 -0
- package/dist/test/unit/core/scan/patterns.test.d.ts.map +1 -0
- package/dist/test/unit/core/scan/patterns.test.js +483 -0
- package/dist/test/unit/core/scan/patterns.test.js.map +1 -0
- package/dist/test/unit/core/scan/scanFile.test.d.ts +2 -0
- package/dist/test/unit/core/scan/scanFile.test.d.ts.map +1 -0
- package/dist/test/unit/core/scan/scanFile.test.js +258 -0
- package/dist/test/unit/core/scan/scanFile.test.js.map +1 -0
- package/dist/test/unit/core/security/entropy.test.d.ts +2 -0
- package/dist/test/unit/core/security/entropy.test.d.ts.map +1 -0
- package/dist/test/unit/core/security/entropy.test.js +34 -0
- package/dist/test/unit/core/security/entropy.test.js.map +1 -0
- package/dist/test/unit/core/security/exampleSecretDetector.test.d.ts +2 -0
- package/dist/test/unit/core/security/exampleSecretDetector.test.d.ts.map +1 -0
- package/dist/test/unit/core/security/exampleSecretDetector.test.js +57 -0
- package/dist/test/unit/core/security/exampleSecretDetector.test.js.map +1 -0
- package/dist/test/unit/core/security/secretDetectors.test.d.ts +2 -0
- package/dist/test/unit/core/security/secretDetectors.test.d.ts.map +1 -0
- package/dist/test/unit/core/security/secretDetectors.test.js +490 -0
- package/dist/test/unit/core/security/secretDetectors.test.js.map +1 -0
- package/dist/test/unit/index.test.d.ts +2 -0
- package/dist/test/unit/index.test.d.ts.map +1 -0
- package/dist/test/unit/index.test.js +17 -0
- package/dist/test/unit/index.test.js.map +1 -0
- package/dist/test/unit/services/detectEnvExpirations.test.d.ts +2 -0
- package/dist/test/unit/services/detectEnvExpirations.test.d.ts.map +1 -0
- package/dist/test/unit/services/detectEnvExpirations.test.js +120 -0
- package/dist/test/unit/services/detectEnvExpirations.test.js.map +1 -0
- package/dist/test/unit/services/envDiscovery.test.d.ts +2 -0
- package/dist/test/unit/services/envDiscovery.test.d.ts.map +1 -0
- package/dist/test/unit/services/envDiscovery.test.js +177 -0
- package/dist/test/unit/services/envDiscovery.test.js.map +1 -0
- package/dist/test/unit/services/envPairing.test.d.ts +2 -0
- package/dist/test/unit/services/envPairing.test.d.ts.map +1 -0
- package/dist/test/unit/services/envPairing.test.js +103 -0
- package/dist/test/unit/services/envPairing.test.js.map +1 -0
- package/dist/test/unit/services/filewalker.test.d.ts +2 -0
- package/dist/test/unit/services/filewalker.test.d.ts.map +1 -0
- package/dist/test/unit/services/filewalker.test.js +422 -0
- package/dist/test/unit/services/filewalker.test.js.map +1 -0
- package/dist/test/unit/services/git.test.d.ts +2 -0
- package/dist/test/unit/services/git.test.d.ts.map +1 -0
- package/dist/test/unit/services/git.test.js +357 -0
- package/dist/test/unit/services/git.test.js.map +1 -0
- package/dist/test/unit/services/printScanResult.test.d.ts +2 -0
- package/dist/test/unit/services/printScanResult.test.d.ts.map +1 -0
- package/dist/test/unit/services/printScanResult.test.js +275 -0
- package/dist/test/unit/services/printScanResult.test.js.map +1 -0
- package/dist/test/unit/services/processComparisonFile.test.d.ts +2 -0
- package/dist/test/unit/services/processComparisonFile.test.d.ts.map +1 -0
- package/dist/test/unit/services/processComparisonFile.test.js +261 -0
- package/dist/test/unit/services/processComparisonFile.test.js.map +1 -0
- package/dist/test/unit/services/scanCodebase.test.d.ts +2 -0
- package/dist/test/unit/services/scanCodebase.test.d.ts.map +1 -0
- package/dist/test/unit/services/scanCodebase.test.js +433 -0
- package/dist/test/unit/services/scanCodebase.test.js.map +1 -0
- package/dist/test/unit/ui/compare/compareJsonOutput.test.d.ts +2 -0
- package/dist/test/unit/ui/compare/compareJsonOutput.test.d.ts.map +1 -0
- package/dist/test/unit/ui/compare/compareJsonOutput.test.js +137 -0
- package/dist/test/unit/ui/compare/compareJsonOutput.test.js.map +1 -0
- package/dist/test/unit/ui/compare/printErrorNotFound.test.d.ts +2 -0
- package/dist/test/unit/ui/compare/printErrorNotFound.test.d.ts.map +1 -0
- package/dist/test/unit/ui/compare/printErrorNotFound.test.js +36 -0
- package/dist/test/unit/ui/compare/printErrorNotFound.test.js.map +1 -0
- package/dist/test/unit/ui/compare/printHeader.test.d.ts +2 -0
- package/dist/test/unit/ui/compare/printHeader.test.d.ts.map +1 -0
- package/dist/test/unit/ui/compare/printHeader.test.js +23 -0
- package/dist/test/unit/ui/compare/printHeader.test.js.map +1 -0
- package/dist/test/unit/ui/compare/printIssues.test.d.ts +2 -0
- package/dist/test/unit/ui/compare/printIssues.test.d.ts.map +1 -0
- package/dist/test/unit/ui/compare/printIssues.test.js +69 -0
- package/dist/test/unit/ui/compare/printIssues.test.js.map +1 -0
- package/dist/test/unit/ui/compare/printPrompt.test.d.ts +2 -0
- package/dist/test/unit/ui/compare/printPrompt.test.d.ts.map +1 -0
- package/dist/test/unit/ui/compare/printPrompt.test.js +40 -0
- package/dist/test/unit/ui/compare/printPrompt.test.js.map +1 -0
- package/dist/test/unit/ui/compare/printStats.test.d.ts +2 -0
- package/dist/test/unit/ui/compare/printStats.test.d.ts.map +1 -0
- package/dist/test/unit/ui/compare/printStats.test.js +52 -0
- package/dist/test/unit/ui/compare/printStats.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printComparisonError.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printComparisonError.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printComparisonError.test.js +28 -0
- package/dist/test/unit/ui/scan/printComparisonError.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printConsolelogWarning.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printConsolelogWarning.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printConsolelogWarning.test.js +118 -0
- package/dist/test/unit/ui/scan/printConsolelogWarning.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printExampleWarnings.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printExampleWarnings.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printExampleWarnings.test.js +63 -0
- package/dist/test/unit/ui/scan/printExampleWarnings.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printExpireWarnings.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printExpireWarnings.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printExpireWarnings.test.js +100 -0
- package/dist/test/unit/ui/scan/printExpireWarnings.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printFrameworkWarnings.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printFrameworkWarnings.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printFrameworkWarnings.test.js +95 -0
- package/dist/test/unit/ui/scan/printFrameworkWarnings.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printHeader.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printHeader.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printHeader.test.js +23 -0
- package/dist/test/unit/ui/scan/printHeader.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printHealthScore.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printHealthScore.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printHealthScore.test.js +44 -0
- package/dist/test/unit/ui/scan/printHealthScore.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printInconsistentNamingWarning.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printInconsistentNamingWarning.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printInconsistentNamingWarning.test.js +55 -0
- package/dist/test/unit/ui/scan/printInconsistentNamingWarning.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printMissing.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printMissing.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printMissing.test.js +71 -0
- package/dist/test/unit/ui/scan/printMissing.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printMissingExample.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printMissingExample.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printMissingExample.test.js +77 -0
- package/dist/test/unit/ui/scan/printMissingExample.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printSecrets.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printSecrets.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printSecrets.test.js +108 -0
- package/dist/test/unit/ui/scan/printSecrets.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printStats.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printStats.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printStats.test.js +42 -0
- package/dist/test/unit/ui/scan/printStats.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printUnused.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printUnused.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printUnused.test.js +35 -0
- package/dist/test/unit/ui/scan/printUnused.test.js.map +1 -0
- package/dist/test/unit/ui/scan/printUppercaseWarning.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/printUppercaseWarning.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/printUppercaseWarning.test.js +44 -0
- package/dist/test/unit/ui/scan/printUppercaseWarning.test.js.map +1 -0
- package/dist/test/unit/ui/scan/scanJsonOutput.test.d.ts +2 -0
- package/dist/test/unit/ui/scan/scanJsonOutput.test.d.ts.map +1 -0
- package/dist/test/unit/ui/scan/scanJsonOutput.test.js +270 -0
- package/dist/test/unit/ui/scan/scanJsonOutput.test.js.map +1 -0
- package/dist/test/unit/ui/shared/printAutoFix.test.d.ts +2 -0
- package/dist/test/unit/ui/shared/printAutoFix.test.d.ts.map +1 -0
- package/dist/test/unit/ui/shared/printAutoFix.test.js +54 -0
- package/dist/test/unit/ui/shared/printAutoFix.test.js.map +1 -0
- package/dist/test/unit/ui/shared/printConfigStatus.test.d.ts +2 -0
- package/dist/test/unit/ui/shared/printConfigStatus.test.d.ts.map +1 -0
- package/dist/test/unit/ui/shared/printConfigStatus.test.js +44 -0
- package/dist/test/unit/ui/shared/printConfigStatus.test.js.map +1 -0
- package/dist/test/unit/ui/shared/printDuplicates.test.d.ts +2 -0
- package/dist/test/unit/ui/shared/printDuplicates.test.d.ts.map +1 -0
- package/dist/test/unit/ui/shared/printDuplicates.test.js +43 -0
- package/dist/test/unit/ui/shared/printDuplicates.test.js.map +1 -0
- package/dist/test/unit/ui/shared/printFixTips.test.d.ts +2 -0
- package/dist/test/unit/ui/shared/printFixTips.test.d.ts.map +1 -0
- package/dist/test/unit/ui/shared/printFixTips.test.js +67 -0
- package/dist/test/unit/ui/shared/printFixTips.test.js.map +1 -0
- package/dist/test/unit/ui/shared/printGitignore.test.d.ts +2 -0
- package/dist/test/unit/ui/shared/printGitignore.test.d.ts.map +1 -0
- package/dist/test/unit/ui/shared/printGitignore.test.js +59 -0
- package/dist/test/unit/ui/shared/printGitignore.test.js.map +1 -0
- package/dist/test/unit/ui/shared/printInitStatus.test.d.ts +2 -0
- package/dist/test/unit/ui/shared/printInitStatus.test.d.ts.map +1 -0
- package/dist/test/unit/ui/shared/printInitStatus.test.js +43 -0
- package/dist/test/unit/ui/shared/printInitStatus.test.js.map +1 -0
- package/dist/test/unit/ui/shared/printOptionErrors.test.d.ts +2 -0
- package/dist/test/unit/ui/shared/printOptionErrors.test.d.ts.map +1 -0
- package/dist/test/unit/ui/shared/printOptionErrors.test.js +57 -0
- package/dist/test/unit/ui/shared/printOptionErrors.test.js.map +1 -0
- package/dist/test/unit/ui/shared/setupGlobalConfig.test.d.ts +2 -0
- package/dist/test/unit/ui/shared/setupGlobalConfig.test.d.ts.map +1 -0
- package/dist/test/unit/ui/shared/setupGlobalConfig.test.js +27 -0
- package/dist/test/unit/ui/shared/setupGlobalConfig.test.js.map +1 -0
- package/dist/test/unit/ui/theme.test.d.ts +2 -0
- package/dist/test/unit/ui/theme.test.d.ts.map +1 -0
- package/dist/test/unit/ui/theme.test.js +61 -0
- package/dist/test/unit/ui/theme.test.js.map +1 -0
- package/dist/test/utils/cli-helpers.d.ts +27 -0
- package/dist/test/utils/cli-helpers.d.ts.map +1 -0
- package/dist/test/utils/cli-helpers.js +46 -0
- package/dist/test/utils/cli-helpers.js.map +1 -0
- package/dist/test/utils/fs-helpers.d.ts +20 -0
- package/dist/test/utils/fs-helpers.d.ts.map +1 -0
- package/dist/test/utils/fs-helpers.js +30 -0
- package/dist/test/utils/fs-helpers.js.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import os from 'os';
|
|
5
|
+
import { compareMany } from '../../../src/commands/compare.js';
|
|
6
|
+
// ---- mocks ----
|
|
7
|
+
vi.mock('../../../src/services/parseEnvFile.js', () => ({
|
|
8
|
+
parseEnvFile: vi.fn(),
|
|
9
|
+
}));
|
|
10
|
+
vi.mock('../../../src/core/diffEnv.js', () => ({
|
|
11
|
+
diffEnv: vi.fn(),
|
|
12
|
+
}));
|
|
13
|
+
vi.mock('../../../src/services/git.js', () => ({
|
|
14
|
+
checkGitignoreStatus: vi.fn(),
|
|
15
|
+
}));
|
|
16
|
+
vi.mock('../../../src/core/duplicates.js', () => ({
|
|
17
|
+
findDuplicateKeys: vi.fn(),
|
|
18
|
+
}));
|
|
19
|
+
vi.mock('../../../src/core/filterIgnoredKeys.js', () => ({
|
|
20
|
+
filterIgnoredKeys: vi.fn((keys) => keys),
|
|
21
|
+
}));
|
|
22
|
+
vi.mock('../../../src/core/compare/updateTotals.js', () => ({
|
|
23
|
+
updateTotals: vi.fn(() => false),
|
|
24
|
+
}));
|
|
25
|
+
vi.mock('../../../src/core/fixEnv.js', () => ({
|
|
26
|
+
applyFixes: vi.fn(),
|
|
27
|
+
}));
|
|
28
|
+
vi.mock('../../../src/ui/shared/printFixTips.js', () => ({
|
|
29
|
+
printFixTips: vi.fn(),
|
|
30
|
+
}));
|
|
31
|
+
vi.mock('../../../src/ui/compare/printStats.js', () => ({
|
|
32
|
+
printStats: vi.fn(),
|
|
33
|
+
}));
|
|
34
|
+
vi.mock('../../../src/ui/shared/printDuplicates.js', () => ({
|
|
35
|
+
printDuplicates: vi.fn(),
|
|
36
|
+
}));
|
|
37
|
+
vi.mock('../../../src/ui/compare/printHeader.js', () => ({
|
|
38
|
+
printHeader: vi.fn(),
|
|
39
|
+
}));
|
|
40
|
+
vi.mock('../../../src/ui/shared/printAutoFix.js', () => ({
|
|
41
|
+
printAutoFix: vi.fn(),
|
|
42
|
+
}));
|
|
43
|
+
vi.mock('../../../src/ui/compare/printIssues.js', () => ({
|
|
44
|
+
printIssues: vi.fn(),
|
|
45
|
+
}));
|
|
46
|
+
vi.mock('../../../src/ui/shared/printSuccess.js', () => ({
|
|
47
|
+
printSuccess: vi.fn(),
|
|
48
|
+
}));
|
|
49
|
+
vi.mock('../../../src/ui/shared/printGitignore.js', () => ({
|
|
50
|
+
printGitignoreWarning: vi.fn(),
|
|
51
|
+
}));
|
|
52
|
+
vi.mock('../../../src/ui/compare/compareJsonOutput.js', () => ({
|
|
53
|
+
compareJsonOutput: vi.fn((params) => params),
|
|
54
|
+
}));
|
|
55
|
+
vi.mock('../../../src/ui/compare/printErrorNotFound.js', () => ({
|
|
56
|
+
printErrorNotFound: vi.fn(),
|
|
57
|
+
}));
|
|
58
|
+
import { parseEnvFile } from '../../../src/services/parseEnvFile.js';
|
|
59
|
+
import { diffEnv } from '../../../src/core/diffEnv.js';
|
|
60
|
+
import { checkGitignoreStatus } from '../../../src/services/git.js';
|
|
61
|
+
import { findDuplicateKeys } from '../../../src/core/duplicates.js';
|
|
62
|
+
import { filterIgnoredKeys } from '../../../src/core/filterIgnoredKeys.js';
|
|
63
|
+
import { updateTotals } from '../../../src/core/compare/updateTotals.js';
|
|
64
|
+
import { applyFixes } from '../../../src/core/fixEnv.js';
|
|
65
|
+
import { printFixTips } from '../../../src/ui/shared/printFixTips.js';
|
|
66
|
+
import { printStats } from '../../../src/ui/compare/printStats.js';
|
|
67
|
+
import { printDuplicates } from '../../../src/ui/shared/printDuplicates.js';
|
|
68
|
+
import { printHeader } from '../../../src/ui/compare/printHeader.js';
|
|
69
|
+
import { printAutoFix } from '../../../src/ui/shared/printAutoFix.js';
|
|
70
|
+
import { printIssues } from '../../../src/ui/compare/printIssues.js';
|
|
71
|
+
import { printGitignoreWarning } from '../../../src/ui/shared/printGitignore.js';
|
|
72
|
+
import { compareJsonOutput } from '../../../src/ui/compare/compareJsonOutput.js';
|
|
73
|
+
import { printErrorNotFound } from '../../../src/ui/compare/printErrorNotFound.js';
|
|
74
|
+
describe('compareMany', () => {
|
|
75
|
+
let cwd;
|
|
76
|
+
let envPath;
|
|
77
|
+
let examplePath;
|
|
78
|
+
const mockParseEnvFile = parseEnvFile;
|
|
79
|
+
const mockDiffEnv = diffEnv;
|
|
80
|
+
const mockCheckGitignoreStatus = checkGitignoreStatus;
|
|
81
|
+
const mockFindDuplicateKeys = findDuplicateKeys;
|
|
82
|
+
const mockFilterIgnoredKeys = filterIgnoredKeys;
|
|
83
|
+
const mockUpdateTotals = updateTotals;
|
|
84
|
+
const mockApplyFixes = applyFixes;
|
|
85
|
+
const mockPrintFixTips = printFixTips;
|
|
86
|
+
const mockPrintStats = printStats;
|
|
87
|
+
const mockPrintDuplicates = printDuplicates;
|
|
88
|
+
const mockPrintHeader = printHeader;
|
|
89
|
+
const mockPrintAutoFix = printAutoFix;
|
|
90
|
+
const mockPrintIssues = printIssues;
|
|
91
|
+
const mockPrintGitignoreWarning = printGitignoreWarning;
|
|
92
|
+
const mockCompareJsonOutput = compareJsonOutput;
|
|
93
|
+
const mockPrintErrorNotFound = printErrorNotFound;
|
|
94
|
+
beforeEach(() => {
|
|
95
|
+
cwd = fs.mkdtempSync(path.join(os.tmpdir(), 'dotenv-diff-compare-'));
|
|
96
|
+
envPath = path.join(cwd, '.env');
|
|
97
|
+
examplePath = path.join(cwd, '.env.example');
|
|
98
|
+
// Create files
|
|
99
|
+
fs.writeFileSync(envPath, 'KEY1=value1\nKEY2=value2\n');
|
|
100
|
+
fs.writeFileSync(examplePath, 'KEY1=\nKEY2=\n');
|
|
101
|
+
// Setup default mock implementations
|
|
102
|
+
mockParseEnvFile.mockImplementation((filePath) => {
|
|
103
|
+
if (filePath === envPath) {
|
|
104
|
+
return { KEY1: 'value1', KEY2: 'value2' };
|
|
105
|
+
}
|
|
106
|
+
return { KEY1: '', KEY2: '' };
|
|
107
|
+
});
|
|
108
|
+
mockDiffEnv.mockReturnValue({
|
|
109
|
+
missing: [],
|
|
110
|
+
extra: [],
|
|
111
|
+
valueMismatches: [],
|
|
112
|
+
});
|
|
113
|
+
mockFindDuplicateKeys.mockReturnValue([]);
|
|
114
|
+
mockCheckGitignoreStatus.mockReturnValue(null);
|
|
115
|
+
mockFilterIgnoredKeys.mockImplementation((keys) => keys);
|
|
116
|
+
mockUpdateTotals.mockReturnValue(false);
|
|
117
|
+
mockCompareJsonOutput.mockImplementation((params) => params);
|
|
118
|
+
});
|
|
119
|
+
afterEach(() => {
|
|
120
|
+
fs.rmSync(cwd, { recursive: true, force: true });
|
|
121
|
+
vi.clearAllMocks();
|
|
122
|
+
});
|
|
123
|
+
const createOptions = (overrides = {}) => ({
|
|
124
|
+
checkValues: false,
|
|
125
|
+
cwd,
|
|
126
|
+
allowDuplicates: false,
|
|
127
|
+
fix: false,
|
|
128
|
+
json: false,
|
|
129
|
+
ignore: [],
|
|
130
|
+
ignoreRegex: [],
|
|
131
|
+
showStats: false,
|
|
132
|
+
strict: false,
|
|
133
|
+
...overrides,
|
|
134
|
+
});
|
|
135
|
+
it('compares successfully when files exist and have no issues', async () => {
|
|
136
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
137
|
+
const opts = createOptions();
|
|
138
|
+
const result = await compareMany(pairs, opts);
|
|
139
|
+
expect(result.exitWithError).toBe(false);
|
|
140
|
+
expect(mockPrintHeader).toHaveBeenCalledWith('.env', '.env.example', false);
|
|
141
|
+
});
|
|
142
|
+
it('returns exitWithError true when both files do not exist', async () => {
|
|
143
|
+
const nonExistentEnv = path.join(cwd, 'missing.env');
|
|
144
|
+
const nonExistentExample = path.join(cwd, 'missing.example');
|
|
145
|
+
const pairs = [
|
|
146
|
+
{
|
|
147
|
+
envName: 'missing.env',
|
|
148
|
+
envPath: nonExistentEnv,
|
|
149
|
+
examplePath: nonExistentExample,
|
|
150
|
+
},
|
|
151
|
+
];
|
|
152
|
+
const opts = createOptions();
|
|
153
|
+
const result = await compareMany(pairs, opts);
|
|
154
|
+
expect(result.exitWithError).toBe(true);
|
|
155
|
+
expect(mockPrintErrorNotFound).toHaveBeenCalled();
|
|
156
|
+
});
|
|
157
|
+
it('detects missing keys and reports them', async () => {
|
|
158
|
+
mockDiffEnv.mockReturnValue({
|
|
159
|
+
missing: ['KEY3'],
|
|
160
|
+
extra: [],
|
|
161
|
+
valueMismatches: [],
|
|
162
|
+
});
|
|
163
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
164
|
+
const opts = createOptions();
|
|
165
|
+
await compareMany(pairs, opts);
|
|
166
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({
|
|
167
|
+
missing: ['KEY3'],
|
|
168
|
+
}), false, false);
|
|
169
|
+
});
|
|
170
|
+
it('detects extra keys and reports them', async () => {
|
|
171
|
+
mockDiffEnv.mockReturnValue({
|
|
172
|
+
missing: [],
|
|
173
|
+
extra: ['EXTRA_KEY'],
|
|
174
|
+
valueMismatches: [],
|
|
175
|
+
});
|
|
176
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
177
|
+
const opts = createOptions();
|
|
178
|
+
await compareMany(pairs, opts);
|
|
179
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({
|
|
180
|
+
extra: ['EXTRA_KEY'],
|
|
181
|
+
}), false, false);
|
|
182
|
+
});
|
|
183
|
+
it('detects empty keys and reports them', async () => {
|
|
184
|
+
mockParseEnvFile.mockImplementation((filePath) => {
|
|
185
|
+
if (filePath === envPath) {
|
|
186
|
+
return { KEY1: '', KEY2: 'value2' };
|
|
187
|
+
}
|
|
188
|
+
return { KEY1: '', KEY2: '' };
|
|
189
|
+
});
|
|
190
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
191
|
+
const opts = createOptions();
|
|
192
|
+
await compareMany(pairs, opts);
|
|
193
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({
|
|
194
|
+
empty: ['KEY1'],
|
|
195
|
+
}), false, false);
|
|
196
|
+
});
|
|
197
|
+
it('detects duplicates in env and example files', async () => {
|
|
198
|
+
mockFindDuplicateKeys.mockImplementation((filePath) => {
|
|
199
|
+
if (filePath === envPath) {
|
|
200
|
+
return [{ key: 'DUP_KEY', count: 2 }];
|
|
201
|
+
}
|
|
202
|
+
if (filePath === examplePath) {
|
|
203
|
+
return [{ key: 'DUP_EX', count: 3 }];
|
|
204
|
+
}
|
|
205
|
+
return [];
|
|
206
|
+
});
|
|
207
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
208
|
+
const opts = createOptions();
|
|
209
|
+
await compareMany(pairs, opts);
|
|
210
|
+
expect(mockPrintDuplicates).toHaveBeenCalledWith('.env', '.env.example', [{ key: 'DUP_KEY', count: 2 }], [{ key: 'DUP_EX', count: 3 }], false, false);
|
|
211
|
+
});
|
|
212
|
+
it('skips duplicates check when allowDuplicates is true', async () => {
|
|
213
|
+
mockFindDuplicateKeys.mockReturnValue([{ key: 'DUP', count: 2 }]);
|
|
214
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
215
|
+
const opts = createOptions({ allowDuplicates: true });
|
|
216
|
+
await compareMany(pairs, opts);
|
|
217
|
+
expect(mockPrintDuplicates).toHaveBeenCalledWith('.env', '.env.example', [], [], false, false);
|
|
218
|
+
});
|
|
219
|
+
it('checks gitignore status and reports issues', async () => {
|
|
220
|
+
mockCheckGitignoreStatus.mockReturnValue({
|
|
221
|
+
reason: 'not-ignored',
|
|
222
|
+
});
|
|
223
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
224
|
+
const opts = createOptions();
|
|
225
|
+
await compareMany(pairs, opts);
|
|
226
|
+
expect(mockPrintGitignoreWarning).toHaveBeenCalledWith({
|
|
227
|
+
envFile: '.env',
|
|
228
|
+
reason: 'not-ignored',
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
it('checks values when checkValues is true', async () => {
|
|
232
|
+
mockDiffEnv.mockReturnValue({
|
|
233
|
+
missing: [],
|
|
234
|
+
extra: [],
|
|
235
|
+
valueMismatches: [
|
|
236
|
+
{ key: 'KEY1', expected: 'expected', actual: 'actual' },
|
|
237
|
+
],
|
|
238
|
+
});
|
|
239
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
240
|
+
const opts = createOptions({ checkValues: true });
|
|
241
|
+
await compareMany(pairs, opts);
|
|
242
|
+
expect(mockDiffEnv).toHaveBeenCalledWith(expect.any(Object), expect.any(Object), true);
|
|
243
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({
|
|
244
|
+
mismatches: [{ key: 'KEY1', expected: 'expected', actual: 'actual' }],
|
|
245
|
+
}), false, false);
|
|
246
|
+
});
|
|
247
|
+
it('applies fixes when fix flag is enabled', async () => {
|
|
248
|
+
mockDiffEnv.mockReturnValue({
|
|
249
|
+
missing: ['MISSING_KEY'],
|
|
250
|
+
extra: [],
|
|
251
|
+
valueMismatches: [],
|
|
252
|
+
});
|
|
253
|
+
mockApplyFixes.mockReturnValue({
|
|
254
|
+
changed: true,
|
|
255
|
+
result: {
|
|
256
|
+
removedDuplicates: [],
|
|
257
|
+
addedEnv: ['MISSING_KEY'],
|
|
258
|
+
gitignoreUpdated: false,
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
262
|
+
const opts = createOptions({ fix: true });
|
|
263
|
+
await compareMany(pairs, opts);
|
|
264
|
+
expect(mockApplyFixes).toHaveBeenCalledWith({
|
|
265
|
+
envPath,
|
|
266
|
+
missingKeys: ['MISSING_KEY'],
|
|
267
|
+
duplicateKeys: [],
|
|
268
|
+
ensureGitignore: false,
|
|
269
|
+
});
|
|
270
|
+
expect(mockPrintAutoFix).toHaveBeenCalledWith({
|
|
271
|
+
fixApplied: true,
|
|
272
|
+
removedDuplicates: [],
|
|
273
|
+
addedEnv: ['MISSING_KEY'],
|
|
274
|
+
gitignoreUpdated: false,
|
|
275
|
+
}, '.env', false);
|
|
276
|
+
});
|
|
277
|
+
it('applies fixes with duplicate keys when duplicates exist', async () => {
|
|
278
|
+
mockDiffEnv.mockReturnValue({
|
|
279
|
+
missing: [],
|
|
280
|
+
extra: [],
|
|
281
|
+
valueMismatches: [],
|
|
282
|
+
});
|
|
283
|
+
mockFindDuplicateKeys.mockImplementation((filePath) => {
|
|
284
|
+
if (filePath === envPath) {
|
|
285
|
+
return [
|
|
286
|
+
{ key: 'DUPLICATE_KEY', count: 2 },
|
|
287
|
+
{ key: 'ANOTHER_DUP', count: 3 },
|
|
288
|
+
];
|
|
289
|
+
}
|
|
290
|
+
return [];
|
|
291
|
+
});
|
|
292
|
+
mockApplyFixes.mockReturnValue({
|
|
293
|
+
changed: true,
|
|
294
|
+
result: {
|
|
295
|
+
removedDuplicates: ['DUPLICATE_KEY', 'ANOTHER_DUP'],
|
|
296
|
+
addedEnv: [],
|
|
297
|
+
gitignoreUpdated: false,
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
301
|
+
const opts = createOptions({ fix: true });
|
|
302
|
+
await compareMany(pairs, opts);
|
|
303
|
+
expect(mockApplyFixes).toHaveBeenCalledWith({
|
|
304
|
+
envPath,
|
|
305
|
+
missingKeys: [],
|
|
306
|
+
duplicateKeys: ['DUPLICATE_KEY', 'ANOTHER_DUP'],
|
|
307
|
+
ensureGitignore: false,
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
it('shows stats when showStats is enabled', async () => {
|
|
311
|
+
mockParseEnvFile.mockImplementation((filePath) => {
|
|
312
|
+
if (filePath === envPath) {
|
|
313
|
+
return { KEY1: 'value1', KEY2: 'value2', KEY3: 'value3' };
|
|
314
|
+
}
|
|
315
|
+
return { KEY1: '', KEY2: '' };
|
|
316
|
+
});
|
|
317
|
+
mockFilterIgnoredKeys.mockImplementation((keys) => keys);
|
|
318
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
319
|
+
const opts = createOptions({ showStats: true });
|
|
320
|
+
await compareMany(pairs, opts);
|
|
321
|
+
expect(mockPrintStats).toHaveBeenCalledWith('.env', '.env.example', expect.objectContaining({
|
|
322
|
+
envCount: 3,
|
|
323
|
+
exampleCount: 2,
|
|
324
|
+
sharedCount: 2,
|
|
325
|
+
}), expect.any(Object), false, true, false);
|
|
326
|
+
});
|
|
327
|
+
it('calculates duplicateCount correctly in stats (count - 1)', async () => {
|
|
328
|
+
mockFindDuplicateKeys.mockImplementation((filePath) => {
|
|
329
|
+
if (filePath === envPath) {
|
|
330
|
+
return [{ key: 'DUP_ENV', count: 3 }]; // contributes 2
|
|
331
|
+
}
|
|
332
|
+
if (filePath === examplePath) {
|
|
333
|
+
return [{ key: 'DUP_EX', count: 2 }]; // contributes 1
|
|
334
|
+
}
|
|
335
|
+
return [];
|
|
336
|
+
});
|
|
337
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
338
|
+
const opts = createOptions({ showStats: true });
|
|
339
|
+
await compareMany(pairs, opts);
|
|
340
|
+
expect(mockPrintStats).toHaveBeenCalledWith('.env', '.env.example', expect.objectContaining({
|
|
341
|
+
duplicateCount: 3, // (3-1) + (2-1) = 2 + 1
|
|
342
|
+
}), expect.any(Object), false, true, false);
|
|
343
|
+
});
|
|
344
|
+
it('returns exitWithError true in strict mode when issues exist', async () => {
|
|
345
|
+
mockDiffEnv.mockReturnValue({
|
|
346
|
+
missing: ['MISSING_KEY'],
|
|
347
|
+
extra: [],
|
|
348
|
+
valueMismatches: [],
|
|
349
|
+
});
|
|
350
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
351
|
+
const opts = createOptions({ strict: true });
|
|
352
|
+
const result = await compareMany(pairs, opts);
|
|
353
|
+
expect(result.exitWithError).toBe(true);
|
|
354
|
+
});
|
|
355
|
+
it('returns exitWithError false in strict mode when no issues exist', async () => {
|
|
356
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
357
|
+
const opts = createOptions({ strict: true });
|
|
358
|
+
const result = await compareMany(pairs, opts);
|
|
359
|
+
expect(result.exitWithError).toBe(false);
|
|
360
|
+
});
|
|
361
|
+
it('filters categories based on --only flag', async () => {
|
|
362
|
+
mockDiffEnv.mockReturnValue({
|
|
363
|
+
missing: ['MISSING'],
|
|
364
|
+
extra: ['EXTRA'],
|
|
365
|
+
valueMismatches: [],
|
|
366
|
+
});
|
|
367
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
368
|
+
const opts = createOptions({ only: ['missing'] });
|
|
369
|
+
await compareMany(pairs, opts);
|
|
370
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({
|
|
371
|
+
missing: ['MISSING'],
|
|
372
|
+
extra: [],
|
|
373
|
+
}), false, false);
|
|
374
|
+
});
|
|
375
|
+
it('skips gitignore check when not in only filter', async () => {
|
|
376
|
+
mockCheckGitignoreStatus.mockReturnValue({
|
|
377
|
+
reason: 'not-ignored',
|
|
378
|
+
});
|
|
379
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
380
|
+
const opts = createOptions({ only: ['missing'] });
|
|
381
|
+
await compareMany(pairs, opts);
|
|
382
|
+
expect(mockPrintGitignoreWarning).not.toHaveBeenCalled();
|
|
383
|
+
});
|
|
384
|
+
it('collects entries when collect callback is provided', async () => {
|
|
385
|
+
const collected = [];
|
|
386
|
+
const collect = (entry) => {
|
|
387
|
+
collected.push(entry);
|
|
388
|
+
};
|
|
389
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
390
|
+
const opts = createOptions({ collect });
|
|
391
|
+
await compareMany(pairs, opts);
|
|
392
|
+
expect(collected).toHaveLength(1);
|
|
393
|
+
expect(collected[0]).toMatchObject({
|
|
394
|
+
envName: '.env',
|
|
395
|
+
exampleName: '.env.example',
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
it('processes multiple pairs sequentially', async () => {
|
|
399
|
+
const env2Path = path.join(cwd, '.env.production');
|
|
400
|
+
fs.writeFileSync(env2Path, 'PROD_KEY=prod\n');
|
|
401
|
+
const pairs = [
|
|
402
|
+
{ envName: '.env', envPath, examplePath },
|
|
403
|
+
{ envName: '.env.production', envPath: env2Path, examplePath },
|
|
404
|
+
];
|
|
405
|
+
const opts = createOptions();
|
|
406
|
+
await compareMany(pairs, opts);
|
|
407
|
+
expect(mockPrintHeader).toHaveBeenCalledTimes(2);
|
|
408
|
+
expect(mockPrintHeader).toHaveBeenNthCalledWith(1, '.env', '.env.example', false);
|
|
409
|
+
expect(mockPrintHeader).toHaveBeenNthCalledWith(2, '.env.production', '.env.example', false);
|
|
410
|
+
});
|
|
411
|
+
it('returns exitWithError true when updateTotals indicates error', async () => {
|
|
412
|
+
mockUpdateTotals.mockReturnValue(true);
|
|
413
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
414
|
+
const opts = createOptions();
|
|
415
|
+
const result = await compareMany(pairs, opts);
|
|
416
|
+
expect(result.exitWithError).toBe(true);
|
|
417
|
+
});
|
|
418
|
+
it('filters ignored keys correctly', async () => {
|
|
419
|
+
mockParseEnvFile.mockImplementation((filePath) => {
|
|
420
|
+
if (filePath === envPath) {
|
|
421
|
+
return { KEY1: 'value1', IGNORED: 'ignored', KEY2: 'value2' };
|
|
422
|
+
}
|
|
423
|
+
return { KEY1: '', KEY2: '' };
|
|
424
|
+
});
|
|
425
|
+
mockFilterIgnoredKeys.mockImplementation((keys, ignore) => {
|
|
426
|
+
return keys.filter((k) => !ignore.includes(k));
|
|
427
|
+
});
|
|
428
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
429
|
+
const opts = createOptions({ ignore: ['IGNORED'] });
|
|
430
|
+
await compareMany(pairs, opts);
|
|
431
|
+
expect(mockFilterIgnoredKeys).toHaveBeenCalledWith(expect.arrayContaining(['KEY1', 'IGNORED', 'KEY2']), ['IGNORED'], []);
|
|
432
|
+
});
|
|
433
|
+
it('filters keys with regex patterns', async () => {
|
|
434
|
+
mockFilterIgnoredKeys.mockImplementation((keys, _ignore, regexList) => {
|
|
435
|
+
return keys.filter((k) => !regexList.some((rx) => rx.test(k)));
|
|
436
|
+
});
|
|
437
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
438
|
+
const opts = createOptions({ ignoreRegex: [/^TEST_/] });
|
|
439
|
+
await compareMany(pairs, opts);
|
|
440
|
+
expect(mockFilterIgnoredKeys).toHaveBeenCalledWith(expect.any(Array), [], [/^TEST_/]);
|
|
441
|
+
});
|
|
442
|
+
it('prints fix tips when issues exist and fix is not enabled', async () => {
|
|
443
|
+
mockDiffEnv.mockReturnValue({
|
|
444
|
+
missing: ['MISSING'],
|
|
445
|
+
extra: [],
|
|
446
|
+
valueMismatches: [],
|
|
447
|
+
});
|
|
448
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
449
|
+
const opts = createOptions({ fix: false });
|
|
450
|
+
await compareMany(pairs, opts);
|
|
451
|
+
expect(mockPrintFixTips).toHaveBeenCalledWith(expect.objectContaining({
|
|
452
|
+
missing: ['MISSING'],
|
|
453
|
+
}), false, false, false);
|
|
454
|
+
});
|
|
455
|
+
it('outputs JSON format when json flag is enabled', async () => {
|
|
456
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
457
|
+
const opts = createOptions({ json: true });
|
|
458
|
+
await compareMany(pairs, opts);
|
|
459
|
+
expect(mockPrintHeader).toHaveBeenCalledWith('.env', '.env.example', true);
|
|
460
|
+
expect(mockPrintStats).not.toHaveBeenCalled(); // No stats in JSON mode
|
|
461
|
+
});
|
|
462
|
+
it('handles empty values correctly', async () => {
|
|
463
|
+
mockParseEnvFile.mockImplementation((filePath) => {
|
|
464
|
+
if (filePath === envPath) {
|
|
465
|
+
return { KEY1: '', KEY2: ' ', KEY3: 'value' };
|
|
466
|
+
}
|
|
467
|
+
return { KEY1: '', KEY2: '', KEY3: '' };
|
|
468
|
+
});
|
|
469
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
470
|
+
const opts = createOptions();
|
|
471
|
+
await compareMany(pairs, opts);
|
|
472
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({
|
|
473
|
+
empty: expect.arrayContaining(['KEY1', 'KEY2']),
|
|
474
|
+
}), false, false);
|
|
475
|
+
});
|
|
476
|
+
it('includes stats in JSON output', async () => {
|
|
477
|
+
mockParseEnvFile.mockImplementation((filePath) => {
|
|
478
|
+
if (filePath === envPath) {
|
|
479
|
+
return { KEY1: 'value1', KEY2: 'value2', KEY3: 'value3' };
|
|
480
|
+
}
|
|
481
|
+
return { KEY1: '', KEY2: '' };
|
|
482
|
+
});
|
|
483
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
484
|
+
const opts = createOptions();
|
|
485
|
+
await compareMany(pairs, opts);
|
|
486
|
+
expect(mockCompareJsonOutput).toHaveBeenCalledWith(expect.objectContaining({
|
|
487
|
+
stats: expect.objectContaining({
|
|
488
|
+
envCount: 3,
|
|
489
|
+
exampleCount: 2,
|
|
490
|
+
sharedCount: 2,
|
|
491
|
+
duplicateCount: 0,
|
|
492
|
+
valueMismatchCount: 0,
|
|
493
|
+
}),
|
|
494
|
+
}));
|
|
495
|
+
});
|
|
496
|
+
it('handles missing example file gracefully', async () => {
|
|
497
|
+
fs.unlinkSync(examplePath);
|
|
498
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
499
|
+
const opts = createOptions();
|
|
500
|
+
const result = await compareMany(pairs, opts);
|
|
501
|
+
expect(result.exitWithError).toBe(true);
|
|
502
|
+
expect(mockPrintErrorNotFound).toHaveBeenCalled();
|
|
503
|
+
});
|
|
504
|
+
it('handles missing env file gracefully', async () => {
|
|
505
|
+
fs.unlinkSync(envPath);
|
|
506
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
507
|
+
const opts = createOptions();
|
|
508
|
+
const result = await compareMany(pairs, opts);
|
|
509
|
+
expect(result.exitWithError).toBe(true);
|
|
510
|
+
expect(mockPrintErrorNotFound).toHaveBeenCalled();
|
|
511
|
+
});
|
|
512
|
+
it('filters duplicate keys by ignore list', async () => {
|
|
513
|
+
mockFindDuplicateKeys.mockReturnValue([
|
|
514
|
+
{ key: 'DUP1', count: 2 },
|
|
515
|
+
{ key: 'IGNORED_DUP', count: 2 },
|
|
516
|
+
]);
|
|
517
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
518
|
+
const opts = createOptions({ ignore: ['IGNORED_DUP'] });
|
|
519
|
+
await compareMany(pairs, opts);
|
|
520
|
+
// The filtering happens inside findDuplicates helper
|
|
521
|
+
expect(mockFindDuplicateKeys).toHaveBeenCalled();
|
|
522
|
+
});
|
|
523
|
+
it('applies gitignore fix when ensureGitignore is true', async () => {
|
|
524
|
+
mockCheckGitignoreStatus.mockReturnValue({
|
|
525
|
+
reason: 'not-ignored',
|
|
526
|
+
});
|
|
527
|
+
mockApplyFixes.mockReturnValue({
|
|
528
|
+
changed: true,
|
|
529
|
+
result: {
|
|
530
|
+
removedDuplicates: [],
|
|
531
|
+
addedEnv: [],
|
|
532
|
+
gitignoreUpdated: true,
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
536
|
+
const opts = createOptions({ fix: true });
|
|
537
|
+
await compareMany(pairs, opts);
|
|
538
|
+
expect(mockApplyFixes).toHaveBeenCalledWith(expect.objectContaining({
|
|
539
|
+
ensureGitignore: true,
|
|
540
|
+
}));
|
|
541
|
+
});
|
|
542
|
+
it('handles multiple issues simultaneously', async () => {
|
|
543
|
+
mockDiffEnv.mockReturnValue({
|
|
544
|
+
missing: ['MISSING1', 'MISSING2'],
|
|
545
|
+
extra: ['EXTRA1'],
|
|
546
|
+
valueMismatches: [{ key: 'KEY1', expected: 'exp', actual: 'act' }],
|
|
547
|
+
});
|
|
548
|
+
mockFindDuplicateKeys.mockReturnValue([{ key: 'DUP', count: 2 }]);
|
|
549
|
+
mockCheckGitignoreStatus.mockReturnValue({
|
|
550
|
+
reason: 'no-gitignore',
|
|
551
|
+
});
|
|
552
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
553
|
+
const opts = createOptions({ checkValues: true, strict: true });
|
|
554
|
+
const result = await compareMany(pairs, opts);
|
|
555
|
+
expect(result.exitWithError).toBe(true);
|
|
556
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({
|
|
557
|
+
missing: ['MISSING1', 'MISSING2'],
|
|
558
|
+
extra: ['EXTRA1'],
|
|
559
|
+
mismatches: [{ key: 'KEY1', expected: 'exp', actual: 'act' }],
|
|
560
|
+
}), false, false);
|
|
561
|
+
expect(mockPrintGitignoreWarning).toHaveBeenCalled();
|
|
562
|
+
});
|
|
563
|
+
it('correctly calculates shared keys count', async () => {
|
|
564
|
+
mockParseEnvFile.mockImplementation((filePath) => {
|
|
565
|
+
if (filePath === envPath) {
|
|
566
|
+
return { KEY1: 'v1', KEY2: 'v2', KEY3: 'v3' };
|
|
567
|
+
}
|
|
568
|
+
return { KEY1: '', KEY2: '', KEY4: '' };
|
|
569
|
+
});
|
|
570
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
571
|
+
const opts = createOptions({ showStats: true });
|
|
572
|
+
await compareMany(pairs, opts);
|
|
573
|
+
expect(mockPrintStats).toHaveBeenCalledWith(expect.any(String), expect.any(String), expect.objectContaining({
|
|
574
|
+
envCount: 3,
|
|
575
|
+
exampleCount: 3,
|
|
576
|
+
sharedCount: 2, // KEY1 and KEY2
|
|
577
|
+
}), expect.any(Object), false, true, false);
|
|
578
|
+
});
|
|
579
|
+
it('falls back ?? false when json and fix are undefined (lines 103, 123-124, 266, 280-281)', async () => {
|
|
580
|
+
// opts.json and opts.fix are undefined → opts.json ?? false and opts.fix ?? false
|
|
581
|
+
// take the right-hand fallback branch for each ?? operator.
|
|
582
|
+
const opts = {
|
|
583
|
+
...createOptions(),
|
|
584
|
+
json: undefined,
|
|
585
|
+
fix: undefined,
|
|
586
|
+
};
|
|
587
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
588
|
+
const result = await compareMany(pairs, opts);
|
|
589
|
+
expect(result.exitWithError).toBe(false);
|
|
590
|
+
// printHeader receives false from opts.json ?? false (line 103)
|
|
591
|
+
expect(mockPrintHeader).toHaveBeenCalledWith('.env', '.env.example', false);
|
|
592
|
+
// printDuplicates receives false for both ?? args (lines 123-124)
|
|
593
|
+
expect(mockPrintDuplicates).toHaveBeenCalledWith('.env', '.env.example', [], [], false, false);
|
|
594
|
+
// printIssues receives false for both ?? args (line 266)
|
|
595
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.any(Object), false, false);
|
|
596
|
+
// printFixTips receives false for both ?? args (lines 280-281)
|
|
597
|
+
expect(mockPrintFixTips).toHaveBeenCalledWith(expect.any(Object), false, false, false);
|
|
598
|
+
});
|
|
599
|
+
it('falls back ?? false/false in printStats when showStats=true and json/checkValues are undefined (lines 244, 246)', async () => {
|
|
600
|
+
// opts.json=undefined → opts.json ?? false = false (line 244 right branch)
|
|
601
|
+
// opts.checkValues=undefined → opts.checkValues ?? false = false (line 246 right branch)
|
|
602
|
+
// opts.showStats=true (defined) → opts.showStats ?? true takes left branch (right is dead code)
|
|
603
|
+
const opts = {
|
|
604
|
+
...createOptions({ showStats: true }),
|
|
605
|
+
json: undefined,
|
|
606
|
+
checkValues: undefined,
|
|
607
|
+
};
|
|
608
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
609
|
+
await compareMany(pairs, opts);
|
|
610
|
+
expect(mockPrintStats).toHaveBeenCalledWith('.env', '.env.example', expect.any(Object), expect.any(Object), false, // opts.json ?? false → false (right branch)
|
|
611
|
+
true, // opts.showStats → true (left branch, defined)
|
|
612
|
+
false);
|
|
613
|
+
});
|
|
614
|
+
it('falls back json ?? false in printAutoFix when fix=true and json is undefined (line 298)', async () => {
|
|
615
|
+
// opts.fix=true → reaches applyFixes + printAutoFix
|
|
616
|
+
// opts.json=undefined → opts.json ?? false takes the right branch (line 298)
|
|
617
|
+
mockApplyFixes.mockReturnValue({
|
|
618
|
+
changed: true,
|
|
619
|
+
result: {
|
|
620
|
+
removedDuplicates: [],
|
|
621
|
+
addedEnv: ['NEW_KEY'],
|
|
622
|
+
gitignoreUpdated: false,
|
|
623
|
+
},
|
|
624
|
+
});
|
|
625
|
+
mockDiffEnv.mockReturnValue({
|
|
626
|
+
missing: ['NEW_KEY'],
|
|
627
|
+
extra: [],
|
|
628
|
+
valueMismatches: [],
|
|
629
|
+
});
|
|
630
|
+
const opts = {
|
|
631
|
+
...createOptions({ fix: true }),
|
|
632
|
+
json: undefined,
|
|
633
|
+
};
|
|
634
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
635
|
+
await compareMany(pairs, opts);
|
|
636
|
+
// printAutoFix called with false from opts.json ?? false
|
|
637
|
+
expect(mockPrintAutoFix).toHaveBeenCalledWith(expect.any(Object), '.env', false);
|
|
638
|
+
});
|
|
639
|
+
it('treats undefined env values as empty via v ?? "" fallback (line 191)', async () => {
|
|
640
|
+
// parseEnvFile returns KEY1: undefined → (v ?? "").trim() === "" takes ?? right branch
|
|
641
|
+
mockParseEnvFile.mockImplementationOnce(() => ({
|
|
642
|
+
KEY1: undefined,
|
|
643
|
+
KEY2: 'value2',
|
|
644
|
+
}));
|
|
645
|
+
// second parseEnvFile call (example file) falls through to the beforeEach default
|
|
646
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
647
|
+
await compareMany(pairs, createOptions());
|
|
648
|
+
// KEY1 has undefined value → treated as empty
|
|
649
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({ empty: ['KEY1'] }), false, false);
|
|
650
|
+
});
|
|
651
|
+
it('excludes missing from filtered when only filter does not include missing (line 201 false branch)', async () => {
|
|
652
|
+
// only: ['extra'] → run('missing') returns false → line 201 takes the [] branch
|
|
653
|
+
mockDiffEnv.mockReturnValue({
|
|
654
|
+
missing: ['MISSING_KEY'],
|
|
655
|
+
extra: ['EXTRA_KEY'],
|
|
656
|
+
valueMismatches: [],
|
|
657
|
+
});
|
|
658
|
+
const pairs = [{ envName: '.env', envPath, examplePath }];
|
|
659
|
+
const opts = createOptions({ only: ['extra'] });
|
|
660
|
+
await compareMany(pairs, opts);
|
|
661
|
+
expect(mockPrintIssues).toHaveBeenCalledWith(expect.objectContaining({ missing: [], extra: ['EXTRA_KEY'] }), false, false);
|
|
662
|
+
});
|
|
663
|
+
});
|
|
664
|
+
//# sourceMappingURL=compare.test.js.map
|