@@ -22,10 +22,8 @@ import sinon from 'sinon'
22
22
import * as vscode from 'vscode'
23
23
import path from 'path'
24
24
25
- const buildRawCodeScanIssue = ( fromProject : boolean = true , params ?: Partial < RawCodeScanIssue > ) : RawCodeScanIssue => ( {
26
- filePath : fromProject
27
- ? 'workspaceFolder/python3.7-plain-sam-app/hello_world/app.py'
28
- : path . join ( getWorkspaceFolder ( ) . substring ( 1 ) , '/python3.7-plain-sam-app/hello_world/app.py' ) ,
25
+ const buildRawCodeScanIssue = ( params ?: Partial < RawCodeScanIssue > ) : RawCodeScanIssue => ( {
26
+ filePath : 'workspaceFolder/python3.7-plain-sam-app/hello_world/app.py' ,
29
27
startLine : 1 ,
30
28
endLine : 1 ,
31
29
title : 'title' ,
@@ -99,21 +97,21 @@ describe('securityScanHandler', function () {
99
97
. onFirstCall ( )
100
98
. resolves (
101
99
buildMockListCodeScanFindingsResponse (
102
- JSON . stringify ( [ buildRawCodeScanIssue ( true , { title : 'title1' } ) ] ) ,
100
+ JSON . stringify ( [ buildRawCodeScanIssue ( { title : 'title1' } ) ] ) ,
103
101
true
104
102
)
105
103
)
106
104
. onSecondCall ( )
107
105
. resolves (
108
106
buildMockListCodeScanFindingsResponse (
109
- JSON . stringify ( [ buildRawCodeScanIssue ( true , { title : 'title2' } ) ] ) ,
107
+ JSON . stringify ( [ buildRawCodeScanIssue ( { title : 'title2' } ) ] ) ,
110
108
true
111
109
)
112
110
)
113
111
. onThirdCall ( )
114
112
. resolves (
115
113
buildMockListCodeScanFindingsResponse (
116
- JSON . stringify ( [ buildRawCodeScanIssue ( true , { title : 'title3' } ) ] ) ,
114
+ JSON . stringify ( [ buildRawCodeScanIssue ( { title : 'title3' } ) ] ) ,
117
115
false
118
116
)
119
117
)
@@ -155,22 +153,6 @@ describe('securityScanHandler', function () {
155
153
)
156
154
}
157
155
} )
158
- it ( 'should include ListCodeScanFindings from opened file that is not from project' , async function ( ) {
159
- mockClient . listCodeScanFindings . resolves (
160
- buildMockListCodeScanFindingsResponse ( JSON . stringify ( [ buildRawCodeScanIssue ( false ) ] ) )
161
- )
162
-
163
- const aggregatedCodeScanIssueList = await listScanResults (
164
- mockClient ,
165
- 'jobId' ,
166
- 'codeScanFindingsSchema' ,
167
- [ ] ,
168
- CodeAnalysisScope . PROJECT ,
169
- undefined
170
- )
171
- assert . equal ( aggregatedCodeScanIssueList . length , 1 )
172
- assert . equal ( aggregatedCodeScanIssueList [ 0 ] . issues . length , 1 )
173
- } )
174
156
} )
175
157
176
158
describe ( 'mapToAggregatedList' , ( ) => {
0 commit comments