@@ -34,6 +34,7 @@ suite("Extension Tests", function () {
3434 await checkCoverage ( ( ) => {
3535 // Look for exact coverage on the file
3636 const spyCall = decorationSpy . getCall ( 0 ) ;
37+ expect ( spyCall ) . to . not . be . null ;
3738 if ( spyCall ) {
3839 const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
3940 expect ( cachedLines . full ) . to . have . lengthOf ( 3 ) ;
@@ -55,6 +56,7 @@ suite("Extension Tests", function () {
5556 await checkCoverage ( ( ) => {
5657 // Look for exact coverage on the file
5758 const spyCall = decorationSpy . getCall ( 0 ) ;
59+ expect ( spyCall ) . to . not . be . null ;
5860 if ( spyCall ) {
5961 const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
6062 expect ( cachedLines . full ) . to . have . lengthOf ( 14 ) ;
@@ -76,6 +78,7 @@ suite("Extension Tests", function () {
7678 await checkCoverage ( ( ) => {
7779 // Look for exact coverage on the file
7880 const spyCall = decorationSpy . getCall ( 0 ) ;
81+ expect ( spyCall ) . to . not . be . null ;
7982 if ( spyCall ) {
8083 const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
8184 expect ( cachedLines . full ) . to . have . lengthOf ( 3 ) ;
@@ -138,6 +141,7 @@ suite("Extension Tests", function () {
138141 await checkCoverage ( ( ) => {
139142 // Look for exact coverage on the file
140143 const spyCall = decorationSpy . getCall ( 0 ) ;
144+ expect ( spyCall ) . to . not . be . null ;
141145 if ( spyCall ) {
142146 const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
143147 expect ( cachedLines . full ) . to . have . lengthOf ( 4 ) ;
@@ -159,6 +163,7 @@ suite("Extension Tests", function () {
159163 await checkCoverage ( ( ) => {
160164 // Look for exact coverage on the file
161165 const spyCall = decorationSpy . getCall ( 0 ) ;
166+ expect ( spyCall ) . to . not . be . null ;
162167 if ( spyCall ) {
163168 const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
164169 expect ( cachedLines . none ) . to . have . lengthOf ( 6 ) ;
@@ -180,6 +185,7 @@ suite("Extension Tests", function () {
180185 await checkCoverage ( ( ) => {
181186 // Look for exact coverage on the file
182187 const spyCall = decorationSpy . getCall ( 0 ) ;
188+ expect ( spyCall ) . to . not . be . null ;
183189 if ( spyCall ) {
184190 const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
185191 expect ( cachedLines . full ) . to . have . lengthOf ( 3 ) ;
@@ -201,6 +207,7 @@ suite("Extension Tests", function () {
201207 await checkCoverage ( ( ) => {
202208 // Look for exact coverage on the file
203209 const spyCall = decorationSpy . getCall ( 0 ) ;
210+ expect ( spyCall ) . to . not . be . null ;
204211 if ( spyCall ) {
205212 const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
206213 expect ( cachedLines . full ) . to . have . lengthOf ( 4 ) ;
@@ -237,8 +244,10 @@ suite("Extension Tests", function () {
237244
238245 await checkCoverage ( ( ) => {
239246 // Look for exact coverage on the file
240- if ( decorationSpy . getCall ( i ) ) {
241- const cachedLines : ICoverageLines = decorationSpy . getCall ( i ) . args [ 1 ] ;
247+ const spyCall = decorationSpy . getCall ( i ) ;
248+ expect ( spyCall ) . to . not . be . null ;
249+ if ( spyCall ) {
250+ const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
242251 expect ( cachedLines . full ) . to . have . lengthOf ( linesCovered ) ;
243252 expect ( cachedLines . none ) . to . have . lengthOf ( linesNotCovered ) ;
244253 }
@@ -258,8 +267,10 @@ suite("Extension Tests", function () {
258267
259268 await checkCoverage ( ( ) => {
260269 // Look for exact coverage on the ruby file
261- if ( decorationSpy . getCall ( 0 ) ) {
262- const cachedLines : ICoverageLines = decorationSpy . getCall ( 0 ) . args [ 1 ] ;
270+ const spyCall = decorationSpy . getCall ( 0 ) ;
271+ expect ( spyCall ) . to . not . be . null ;
272+ if ( spyCall ) {
273+ const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
263274 expect ( cachedLines . full ) . to . have . lengthOf ( 4 ) ;
264275 expect ( cachedLines . partial ) . to . have . lengthOf ( 1 ) ;
265276 expect ( cachedLines . none ) . to . have . lengthOf ( 1 ) ;
@@ -288,8 +299,10 @@ suite("Extension Tests", function () {
288299
289300 await checkCoverage ( ( ) => {
290301 // Look for exact coverage on the file
291- if ( decorationSpy . getCall ( 0 ) ) {
292- const cachedLines : ICoverageLines = decorationSpy . getCall ( 0 ) . args [ 1 ] ;
302+ const spyCall = decorationSpy . getCall ( 0 ) ;
303+ expect ( spyCall ) . to . not . be . null ;
304+ if ( spyCall ) {
305+ const cachedLines : ICoverageLines = spyCall . args [ 1 ] ;
293306 expect ( cachedLines . full ) . to . have . lengthOf ( 14 ) ;
294307 expect ( cachedLines . none ) . to . have . lengthOf ( 4 ) ;
295308 expect ( cachedLines . partial ) . to . have . lengthOf ( 7 ) ;
@@ -309,9 +322,11 @@ suite("Extension Tests", function () {
309322 await vscode . window . showTextDocument ( testJSDocument ) ;
310323
311324 await checkCoverage ( ( ) => {
312- if ( decorationSpy . getCall ( 0 ) ) {
325+ const spyCall = decorationSpy . getCall ( 0 ) ;
326+ expect ( spyCall ) . to . not . be . null ;
327+ if ( spyCall ) {
313328 // Look for exact coverage on the file
314- const jsCachedLines : ICoverageLines = decorationSpy . getCall ( 0 ) . args [ 1 ] ;
329+ const jsCachedLines : ICoverageLines = spyCall . args [ 1 ] ;
315330 expect ( jsCachedLines . full ) . to . have . lengthOf ( 14 ) ;
316331 expect ( jsCachedLines . none ) . to . have . lengthOf ( 4 ) ;
317332 expect ( jsCachedLines . partial ) . to . have . lengthOf ( 7 ) ;
@@ -326,9 +341,11 @@ suite("Extension Tests", function () {
326341 await wait ( 500 ) ;
327342
328343 await checkCoverage ( ( ) => {
329- if ( decorationSpy . getCall ( 1 ) ) {
344+ const spyCall = decorationSpy . getCall ( 1 ) ;
345+ expect ( spyCall ) . to . not . be . null ;
346+ if ( spyCall ) {
330347 // Look for exact coverage on the file
331- const javaCachedLines : ICoverageLines = decorationSpy . getCall ( 1 ) . args [ 1 ] ;
348+ const javaCachedLines : ICoverageLines = spyCall . args [ 1 ] ;
332349 expect ( javaCachedLines . full ) . to . have . lengthOf ( 4 ) ;
333350 expect ( javaCachedLines . none ) . to . have . lengthOf ( 3 ) ;
334351 }
@@ -353,25 +370,25 @@ suite("Extension Tests", function () {
353370 setCoverageSpy . resetHistory ( ) ;
354371 await vscode . window . showTextDocument ( testJSDocument , vscode . ViewColumn . One ) ;
355372
356- expect ( setCoverageSpy . calledWith ( 84 ) )
373+ expect ( setCoverageSpy . calledWith ( 84 ) ) . to . be . true ;
357374 setCoverageSpy . resetHistory ( ) ;
358375
359376 const [ testJavaCoverage ] = await vscode . workspace . findFiles ( "**/App.java" , "**/node_modules/**" ) ;
360377 const testJavaDocument = await vscode . workspace . openTextDocument ( testJavaCoverage ) ;
361378
362- await vscode . window . showTextDocument ( testJavaDocument , vscode . ViewColumn . Two ) ;
379+ await vscode . window . showTextDocument ( testJavaDocument , vscode . ViewColumn . Two , false ) ;
363380
364- expect ( setCoverageSpy . calledWith ( 57 ) ) ;
381+ expect ( setCoverageSpy . calledWith ( 57 ) ) . to . be . true ;
365382 setCoverageSpy . resetHistory ( ) ;
366383
367384 await vscode . commands . executeCommand ( "workbench.action.previousEditor" ) ;
368385
369- expect ( setCoverageSpy . calledWith ( 84 ) ) ;
386+ expect ( setCoverageSpy . calledWith ( 84 ) ) . to . be . true ;
370387 setCoverageSpy . resetHistory ( ) ;
371388
372389 await vscode . commands . executeCommand ( "workbench.action.closeAllEditors" ) ;
373390
374- expect ( setCoverageSpy . calledWith ( undefined ) ) ;
391+ expect ( setCoverageSpy . calledWith ( undefined ) ) . to . be . true ;
375392
376393 setCoverageSpy . restore ( ) ;
377394 return vscode . commands . executeCommand ( "coverage-gutters.removeWatch" ) ;
0 commit comments