mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-14 06:06:04 +01:00
Adding enhancement (and test) that compensates for an invalid package.json (one without a name field) and automatically adds the name field with a value of "1" so that the analysis continues rather than fails. #975
This commit is contained in:
@@ -91,4 +91,11 @@ public class NspAnalyzerTest extends BaseTest {
|
||||
// node modules are not scanned - no evidence is collected
|
||||
assertTrue(result.size() == 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnalyzeInvalidPackageMissingName() throws AnalysisException {
|
||||
final Dependency result = new Dependency(BaseTest.getResourceAsFile(this, "nsp/minimal-invalid.json"));
|
||||
analyzer.analyze(result, null);
|
||||
// Upon analysis, not throwing an exception in this case, is all that's required to pass this test
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ "devDependencies": { "generator-jhipster": "4.5.2" } }
|
||||
Reference in New Issue
Block a user