@@ -2,9 +2,8 @@ import { expect } from 'chai';
22import * as sinon from 'sinon' ;
33import './mocks/vscode-mock' ;
44import './mocks/cxWrapper-mock' ;
5- import { mockDiagnosticCollection , mock } from './mocks/vscode-mock' ;
5+ import { mockDiagnosticCollection } from './mocks/vscode-mock' ;
66import { AscaScannerService } from '../realtimeScanners/scanners/asca/ascaScannerService' ;
7- import { SecretsScannerService } from '../realtimeScanners/scanners/secrets/secretsScannerService' ;
87import type CxAsca from "@checkmarx/ast-cli-javascript-wrapper/dist/main/asca/CxAsca" ;
98import type { Uri } from 'vscode' ;
109import { constants } from '../utils/common/constants' ;
@@ -186,37 +185,6 @@ describe('AscaScannerService', () => {
186185 expect ( storedData . description ) . to . equal ( 'Fix this issue' ) ; // Should use remediationAdvise
187186 } ) ;
188187
189- it ( 'should keep ASCA diagnostics when a Secret exists on the same line' , ( ) => {
190- // Register secrets scanner collection and simulate an existing secret diagnostic.
191- new SecretsScannerService ( ) ;
192- ( mock . languages as any ) . getDiagnostics = sandbox . stub ( ) . returns ( [
193- {
194- range : { start : { line : 0 , character : 0 } , end : { line : 0 , character : 10 } } ,
195- data : { cxType : constants . secretsScannerEngineName }
196- }
197- ] ) ;
198-
199- const mockScanResult : CxAsca = {
200- scanDetails : [
201- {
202- line : 1 ,
203- problematicLine : 'const password = "secret"; eval(userInput);' ,
204- ruleName : 'Avoid Eval Usage' ,
205- description : 'Using eval() can lead to code injection vulnerabilities' ,
206- remediationAdvise : 'Use safer alternatives to eval()' ,
207- severity : 'HIGH' ,
208- ruleId : 12345
209- }
210- ]
211- } as CxAsca ;
212-
213- ascaService . updateProblems ( mockScanResult , mockUri ) ;
214-
215- const diagnostics = mockDiagnosticCollection . set . getCall ( 0 ) . args [ 1 ] ;
216- expect ( diagnostics ) . to . have . length ( 1 ) ;
217- expect ( diagnostics [ 0 ] . message ) . to . equal ( 'Avoid Eval Usage' ) ;
218- } ) ;
219-
220188 it . skip ( 'should handle multiple problems on the same line' , ( ) => {
221189 const mockScanResult : CxAsca = {
222190 scanDetails : [
0 commit comments