@@ -78,9 +78,9 @@ public async Task TestNpmDetector_AuthorNameAndAuthorEmailDetected_WhenAuthorNam
7878 {
7979 var authorName = GetRandomString ( ) ;
8080 var authorEmail = GetRandomString ( ) ;
81- var authroUrl = GetRandomString ( ) ;
81+ var authorUrl = GetRandomString ( ) ;
8282 var ( packageJsonName , packageJsonContents , packageJsonPath ) =
83- NpmTestUtilities . GetPackageJsonNoDependenciesForAuthorAndEmailAsSingleString ( authorName , authorEmail , authroUrl ) ;
83+ NpmTestUtilities . GetPackageJsonNoDependenciesForAuthorAndEmailAsSingleString ( authorName , authorEmail , authorUrl ) ;
8484
8585 var ( scanResult , componentRecorder ) = await this . DetectorTestUtility
8686 . WithFile ( packageJsonName , packageJsonContents , this . packageJsonSearchPattern , fileLocation : packageJsonPath )
@@ -97,9 +97,9 @@ public async Task TestNpmDetector_AuthorNameAndAuthorEmailDetected_WhenAuthorNam
9797 public async Task TestNpmDetector_AuthorNameDetected_WhenEmailNotPresentAndUrlIsPresent_AuthorAsSingleStringAsync ( )
9898 {
9999 var authorName = GetRandomString ( ) ;
100- var authroUrl = GetRandomString ( ) ;
100+ var authorUrl = GetRandomString ( ) ;
101101 var ( packageJsonName , packageJsonContents , packageJsonPath ) =
102- NpmTestUtilities . GetPackageJsonNoDependenciesForAuthorAndEmailAsSingleString ( authorName , null , authroUrl ) ;
102+ NpmTestUtilities . GetPackageJsonNoDependenciesForAuthorAndEmailAsSingleString ( authorName , null , authorUrl ) ;
103103
104104 var ( scanResult , componentRecorder ) = await this . DetectorTestUtility
105105 . WithFile ( packageJsonName , packageJsonContents , this . packageJsonSearchPattern , fileLocation : packageJsonPath )
@@ -116,10 +116,10 @@ public async Task TestNpmDetector_AuthorNameDetected_WhenEmailNotPresentAndUrlIs
116116 public async Task TestNpmDetector_AuthorNull_WhenAuthorMalformed_AuthorAsSingleStringAsync ( )
117117 {
118118 var authorName = GetRandomString ( ) ;
119- var authroUrl = GetRandomString ( ) ;
119+ var authorUrl = GetRandomString ( ) ;
120120 var authorEmail = GetRandomString ( ) ;
121121 var ( packageJsonName , packageJsonContents , packageJsonPath ) =
122- NpmTestUtilities . GetPackageJsonNoDependenciesMalformedAuthorAsSingleString ( authorName , authorEmail , authroUrl ) ;
122+ NpmTestUtilities . GetPackageJsonNoDependenciesMalformedAuthorAsSingleString ( authorName , authorEmail , authorUrl ) ;
123123
124124 var ( scanResult , componentRecorder ) = await this . DetectorTestUtility
125125 . WithFile ( packageJsonName , packageJsonContents , this . packageJsonSearchPattern , fileLocation : packageJsonPath )
@@ -135,7 +135,6 @@ public async Task TestNpmDetector_AuthorNull_WhenAuthorMalformed_AuthorAsSingleS
135135 public async Task TestNpmDetector_AuthorNameDetected_WhenEmailNotPresentAndUrlNotPresent_AuthorAsSingleStringAsync ( )
136136 {
137137 var authorName = GetRandomString ( ) ;
138- var authroUrl = GetRandomString ( ) ;
139138 var ( packageJsonName , packageJsonContents , packageJsonPath ) =
140139 NpmTestUtilities . GetPackageJsonNoDependenciesForAuthorAndEmailAsSingleString ( authorName ) ;
141140
@@ -208,6 +207,38 @@ public async Task TestNpmDetector_NullAuthor_WhenAuthorNameIsNullOrEmpty_AuthorA
208207 ( ( NpmComponent ) detectedComponents . First ( ) . Component ) . Author . Should ( ) . BeNull ( ) ;
209208 }
210209
210+ [ TestMethod ]
211+ public async Task TestNpmDetector_NodeEngineDoesNotCauseSkippedPackageAsync ( )
212+ {
213+ var componentName = GetRandomString ( ) ;
214+ var version = NewRandomVersion ( ) ;
215+ var ( packageJsonName , packageJsonContents , packageJsonPath ) =
216+ NpmTestUtilities . GetPackageJsonNoDependenciesForNameAndVersionWithNodeEngine ( componentName , version ) ;
217+
218+ var ( scanResult , componentRecorder ) = await this . DetectorTestUtility
219+ . WithFile ( packageJsonName , packageJsonContents , this . packageJsonSearchPattern , fileLocation : packageJsonPath )
220+ . ExecuteDetectorAsync ( ) ;
221+ scanResult . ResultCode . Should ( ) . Be ( ProcessingResultCode . Success ) ;
222+ var detectedComponents = componentRecorder . GetDetectedComponents ( ) ;
223+ detectedComponents . Should ( ) . ContainSingle ( ) ;
224+ }
225+
226+ [ TestMethod ]
227+ public async Task TestNpmDetector_VSCodeEngineCausesSkippedPackageAsync ( )
228+ {
229+ var componentName = GetRandomString ( ) ;
230+ var version = NewRandomVersion ( ) ;
231+ var ( packageJsonName , packageJsonContents , packageJsonPath ) =
232+ NpmTestUtilities . GetPackageJsonNoDependenciesForNameAndVersionWithVSCodeEngine ( componentName , version ) ;
233+
234+ var ( scanResult , componentRecorder ) = await this . DetectorTestUtility
235+ . WithFile ( packageJsonName , packageJsonContents , this . packageJsonSearchPattern , fileLocation : packageJsonPath )
236+ . ExecuteDetectorAsync ( ) ;
237+ scanResult . ResultCode . Should ( ) . Be ( ProcessingResultCode . Success ) ;
238+ var detectedComponents = componentRecorder . GetDetectedComponents ( ) ;
239+ detectedComponents . Should ( ) . BeEmpty ( ) ;
240+ }
241+
211242 private static void AssertDetectedComponentCount ( IEnumerable < DetectedComponent > detectedComponents , int expectedCount )
212243 {
213244 detectedComponents . Should ( ) . HaveCount ( expectedCount ) ;
0 commit comments