Skip to content

Commit 41e71f6

Browse files
authored
fix: Should setup TestNG correctly (#1362)
Signed-off-by: Sheng Chen <[email protected]>
1 parent b9563a2 commit 41e71f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/commands/testDependenciesCommands.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ function getJarIds(testKind: TestKind): IArtifactMetadata[] {
159159
groupId: 'com.beust',
160160
artifactId: 'jcommander',
161161
defaultVersion: '1.81',
162+
}, {
163+
groupId: 'org.slf4j',
164+
artifactId: 'slf4j-api',
165+
defaultVersion: '1.7.33',
162166
}];
163167
default:
164168
return [];
@@ -255,9 +259,11 @@ async function updateProjectSettings(projectUri: Uri, libFolder: string): Promis
255259
let referencedLibraries: any = configuration.get('project.referencedLibraries');
256260
if (_.isArray(referencedLibraries)) {
257261
referencedLibraries.push(testDependencies);
262+
referencedLibraries = Array.from(new Set(referencedLibraries));
258263
} else if (_.isObject(referencedLibraries)) {
259264
referencedLibraries = referencedLibraries as {include: string[]};
260265
referencedLibraries.include.push(testDependencies);
266+
referencedLibraries.include = Array.from(new Set(referencedLibraries.include));
261267
if (!referencedLibraries.exclude && !referencedLibraries.sources) {
262268
referencedLibraries = referencedLibraries.include;
263269
}

0 commit comments

Comments
 (0)