@@ -30,6 +30,7 @@ describe('CodeCoveragePublisherTests', function() {
30
30
var reportDirectory = path . join ( shell . tempdir ( ) , "report" ) ;
31
31
shell . mkdir ( '-p' , reportDirectory ) ;
32
32
shell . cp ( '-r' , path . resolve ( __dirname , './codecoveragefiles' ) , reportDirectory ) ;
33
+ shell . cp ( '-r' , path . resolve ( __dirname , './codecoveragefiles/index.html' ) , reportDirectory ) ;
33
34
var testExecutionContext ;
34
35
35
36
it ( 'codecoverage.publish : publish summary fails when code coverage tool is invalid' , function ( done ) {
@@ -370,6 +371,7 @@ describe('CodeCoveragePublisherTests', function() {
370
371
assert ( testExecutionContext . service . containerItems . length == 1 ) ;
371
372
assert ( testExecutionContext . service . artifactNames . length == 1 ) ;
372
373
assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" ) ;
374
+ assert ( testExecutionContext . service . browsableArtifacts . length == 0 ) ;
373
375
assert ( result ) ;
374
376
done ( ) ;
375
377
} ,
@@ -393,9 +395,11 @@ describe('CodeCoveragePublisherTests', function() {
393
395
var codeCoveragePublishCommand = new cpc . CodeCoveragePublishCommand ( testExecutionContext , command ) ;
394
396
codeCoveragePublishCommand . runCommandAsync ( ) . then ( function ( result ) {
395
397
assert ( testExecutionContext . service . jobsCompletedSuccessfully ( ) , 'CodeCoveragePublish Task Failed! Details : ' + testExecutionContext . service . getRecordsString ( ) ) ;
396
- assert ( testExecutionContext . service . containerItems . length == 7 ) ;
398
+ assert ( testExecutionContext . service . containerItems . length == 9 ) ;
397
399
assert ( testExecutionContext . service . artifactNames . length == 1 ) ;
398
- assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" )
400
+ assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" ) ;
401
+ assert ( testExecutionContext . service . browsableArtifacts . length == 1 ) ;
402
+ assert ( testExecutionContext . service . browsableArtifacts [ 0 ] == "Code Coverage Report_1" ) ;
399
403
assert ( result ) ;
400
404
done ( ) ;
401
405
} ,
@@ -419,10 +423,12 @@ describe('CodeCoveragePublisherTests', function() {
419
423
var codeCoveragePublishCommand = new cpc . CodeCoveragePublishCommand ( testExecutionContext , command ) ;
420
424
codeCoveragePublishCommand . runCommandAsync ( ) . then ( function ( result ) {
421
425
assert ( testExecutionContext . service . jobsCompletedSuccessfully ( ) , 'CodeCoveragePublish Task Failed! Details : ' + testExecutionContext . service . getRecordsString ( ) ) ;
422
- assert ( testExecutionContext . service . containerItems . length == 9 ) ;
426
+ assert ( testExecutionContext . service . containerItems . length == 11 ) ;
423
427
assert ( testExecutionContext . service . artifactNames . length == 2 ) ;
424
- assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" )
425
- assert ( testExecutionContext . service . artifactNames [ 1 ] == "Code Coverage Files_1" )
428
+ assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" ) ;
429
+ assert ( testExecutionContext . service . artifactNames [ 1 ] == "Code Coverage Files_1" ) ;
430
+ assert ( testExecutionContext . service . browsableArtifacts . length == 1 ) ;
431
+ assert ( testExecutionContext . service . browsableArtifacts [ 0 ] == "Code Coverage Report_1" ) ;
426
432
assert ( result ) ;
427
433
done ( ) ;
428
434
} ,
@@ -450,6 +456,7 @@ describe('CodeCoveragePublisherTests', function() {
450
456
assert ( testExecutionContext . service . artifactNames . length == 2 ) ;
451
457
assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" ) ;
452
458
assert ( testExecutionContext . service . artifactNames [ 1 ] == "Code Coverage Files_1" ) ;
459
+ assert ( testExecutionContext . service . browsableArtifacts . length == 0 ) ;
453
460
assert ( result ) ;
454
461
done ( ) ;
455
462
} ,
@@ -477,6 +484,7 @@ describe('CodeCoveragePublisherTests', function() {
477
484
assert ( testExecutionContext . service . artifactNames . length == 2 ) ;
478
485
assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" ) ;
479
486
assert ( testExecutionContext . service . artifactNames [ 1 ] == "Code Coverage Files_1" ) ;
487
+ assert ( testExecutionContext . service . browsableArtifacts . length == 0 ) ;
480
488
assert ( result ) ;
481
489
done ( ) ;
482
490
} ,
@@ -510,6 +518,7 @@ describe('CodeCoveragePublisherTests', function() {
510
518
assert ( testExecutionContext . service . artifactNames . length == 2 ) ;
511
519
assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" ) ;
512
520
assert ( testExecutionContext . service . artifactNames [ 1 ] == "Code Coverage Files_1" ) ;
521
+ assert ( testExecutionContext . service . browsableArtifacts . length == 0 ) ;
513
522
assert ( result ) ;
514
523
done ( ) ;
515
524
} ,
@@ -533,14 +542,16 @@ describe('CodeCoveragePublisherTests', function() {
533
542
534
543
var codeCoveragePublishCommand = new cpc . CodeCoveragePublishCommand ( testExecutionContext , command ) ;
535
544
codeCoveragePublishCommand . runCommandAsync ( ) . then ( function ( result ) {
536
- assert ( false , 'Publish code coverage Task did not fail as expected' )
545
+ assert ( false , 'Publish code coverage Task did not fail as expected' ) ;
537
546
done ( ) ;
538
547
} ,
539
548
function ( err ) {
540
- assert ( testExecutionContext . service . containerItems . length == 7 ) ;
549
+ assert ( testExecutionContext . service . containerItems . length == 9 ) ;
541
550
assert ( testExecutionContext . service . artifactNames . length == 1 ) ;
542
- assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" )
543
- assert ( err == "Error: Error occured while publishing artifact" )
551
+ assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" ) ;
552
+ assert ( testExecutionContext . service . browsableArtifacts . length == 1 ) ;
553
+ assert ( testExecutionContext . service . browsableArtifacts [ 0 ] == "Code Coverage Report_1" ) ;
554
+ assert ( err == "Error: Error occured while publishing artifact" ) ;
544
555
done ( ) ;
545
556
} ) ;
546
557
} )
@@ -563,10 +574,12 @@ describe('CodeCoveragePublisherTests', function() {
563
574
done ( ) ;
564
575
} ,
565
576
function ( err ) {
566
- assert ( testExecutionContext . service . containerItems . length == 9 ) ;
577
+ assert ( testExecutionContext . service . containerItems . length == 11 ) ;
567
578
assert ( testExecutionContext . service . artifactNames . length == 2 ) ;
568
579
assert ( testExecutionContext . service . artifactNames [ 0 ] == "Code Coverage Report_1" ) ;
569
- assert ( testExecutionContext . service . artifactNames [ 1 ] == "Code Coverage Files_1" )
580
+ assert ( testExecutionContext . service . artifactNames [ 1 ] == "Code Coverage Files_1" ) ;
581
+ assert ( testExecutionContext . service . browsableArtifacts . length == 1 ) ;
582
+ assert ( testExecutionContext . service . browsableArtifacts [ 0 ] == "Code Coverage Report_1" ) ;
570
583
assert ( err == "Error: Error occured while publishing artifact" )
571
584
done ( ) ;
572
585
} ) ;
0 commit comments