Skip to content

Commit

Permalink
fix: Should setup TestNG correctly (#1362)
Browse files Browse the repository at this point in the history
Signed-off-by: Sheng Chen <[email protected]>
  • Loading branch information
jdneo authored Jan 24, 2022
1 parent b9563a2 commit 41e71f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/commands/testDependenciesCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ function getJarIds(testKind: TestKind): IArtifactMetadata[] {
groupId: 'com.beust',
artifactId: 'jcommander',
defaultVersion: '1.81',
}, {
groupId: 'org.slf4j',
artifactId: 'slf4j-api',
defaultVersion: '1.7.33',
}];
default:
return [];
Expand Down Expand Up @@ -255,9 +259,11 @@ async function updateProjectSettings(projectUri: Uri, libFolder: string): Promis
let referencedLibraries: any = configuration.get('project.referencedLibraries');
if (_.isArray(referencedLibraries)) {
referencedLibraries.push(testDependencies);
referencedLibraries = Array.from(new Set(referencedLibraries));
} else if (_.isObject(referencedLibraries)) {
referencedLibraries = referencedLibraries as {include: string[]};
referencedLibraries.include.push(testDependencies);
referencedLibraries.include = Array.from(new Set(referencedLibraries.include));
if (!referencedLibraries.exclude && !referencedLibraries.sources) {
referencedLibraries = referencedLibraries.include;
}
Expand Down

0 comments on commit 41e71f6

Please sign in to comment.