From 9d7b3a9d8e428daf188699c80d4028da725010a2 Mon Sep 17 00:00:00 2001 From: MarcusArdelean Date: Fri, 26 Apr 2024 10:43:53 +0300 Subject: [PATCH] fix: revert v3.4.0 changes --- lib/index.ts | 16 +++------------- tests/tap/system/plugin.test.ts | 24 ------------------------ 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 3cf6696..90a2a4b 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -34,7 +34,6 @@ export interface MavenOptions extends legacyPlugin.BaseInspectOptions { scanAllUnmanaged?: boolean; allProjects?: boolean; mavenAggregateProject?: boolean; - unpruned?: boolean; } export function getCommand(root: string, targetFile: string | undefined) { @@ -159,7 +158,9 @@ export async function inspect( const mavenCommand = getCommand(root, targetFile); const mvnWorkingDirectory = findWrapper(mavenCommand, root, targetPath); - const verboseEnabled = handleVerbose(options); + const args = options.args || []; + const verboseEnabled = + args.includes('-Dverbose') || args.includes('-Dverbose=true'); const mvnArgs = buildArgs( root, mvnWorkingDirectory, @@ -260,14 +261,3 @@ export function buildArgs( return args; } - -function handleVerbose(options): boolean { - const args = options.args || []; - const verboseFlag = - args.includes('-Dverbose') || args.includes('-Dverbose=true'); - if (options.unpruned && !verboseFlag) { - args.push('-Dverbose'); - options.args = args; - } - return verboseFlag || options.unpruned; -} diff --git a/tests/tap/system/plugin.test.ts b/tests/tap/system/plugin.test.ts index b07f34f..a87d22c 100644 --- a/tests/tap/system/plugin.test.ts +++ b/tests/tap/system/plugin.test.ts @@ -408,27 +408,3 @@ test('inspect on verbose-project pom using -Dverbose', async (t) => { 'returns expected dep-graph', ); }); - -test('inspect on test-project pom using --unpruned', async (t) => { - const result = await plugin.inspect( - '.', - path.join(testProjectPath, 'pom.xml'), - { - unpruned: true, - }, - ); - if (!legacyPlugin.isMultiResult(result)) { - return t.fail('expected multi inspect result'); - } - t.equal(result.scannedProjects.length, 1, 'returns 1 scanned project'); - const expectedJSON = await readFixtureJSON( - 'test-project', - 'expected-verbose-dep-graph.json', - ); - const expectedDepGraph = depGraphLib.createFromJSON(expectedJSON); - t.same( - result.scannedProjects[0].depGraph?.toJSON(), - expectedDepGraph.toJSON(), - 'returns expected dep-graph', - ); -});