@@ -189,6 +189,9 @@ module FourSlash {
189
189
}
190
190
191
191
export var currentTestState : TestState = null ;
192
+ function assertionMessage ( msg : string ) {
193
+ return "\nMarker: " + currentTestState . lastKnownMarker + "\nChecking: " + msg + "\n\n" ;
194
+ }
192
195
193
196
export class TestCancellationToken implements ts . CancellationToken {
194
197
// 0 - cancelled
@@ -652,14 +655,14 @@ module FourSlash {
652
655
653
656
var details = this . getCompletionEntryDetails ( entryName ) ;
654
657
655
- assert . equal ( ts . displayPartsToString ( details . displayParts ) , expectedText ) ;
658
+ assert . equal ( ts . displayPartsToString ( details . displayParts ) , expectedText , assertionMessage ( "completion entry details text" ) ) ;
656
659
657
660
if ( expectedDocumentation != undefined ) {
658
- assert . equal ( ts . displayPartsToString ( details . documentation ) , expectedDocumentation ) ;
661
+ assert . equal ( ts . displayPartsToString ( details . documentation ) , expectedDocumentation , assertionMessage ( "completion entry documentation" ) ) ;
659
662
}
660
663
661
664
if ( kind !== undefined ) {
662
- assert . equal ( details . kind , kind ) ;
665
+ assert . equal ( details . kind , kind , assertionMessage ( "completion entry kind" ) ) ;
663
666
}
664
667
}
665
668
@@ -766,10 +769,6 @@ module FourSlash {
766
769
var actualQuickInfoText = actualQuickInfo ? ts . displayPartsToString ( actualQuickInfo . displayParts ) : "" ;
767
770
var actualQuickInfoDocumentation = actualQuickInfo ? ts . displayPartsToString ( actualQuickInfo . documentation ) : "" ;
768
771
769
- function assertionMessage ( msg : string ) {
770
- return "\nMarker: " + currentTestState . lastKnownMarker + "\nChecking: " + msg + "\n\n" ;
771
- }
772
-
773
772
if ( negative ) {
774
773
if ( expectedText !== undefined ) {
775
774
assert . notEqual ( actualQuickInfoText , expectedText , assertionMessage ( "quick info text" ) ) ;
@@ -842,7 +841,7 @@ module FourSlash {
842
841
843
842
var activeParameter = this . getActiveParameter ( ) ;
844
843
var activeParameterDocComment = activeParameter . documentation ;
845
- assert . equal ( activeParameterDocComment , docComment ) ;
844
+ assert . equal ( ts . displayPartsToString ( activeParameterDocComment ) , docComment , assertionMessage ( "current parameter Help DocComment" ) ) ;
846
845
}
847
846
848
847
public verifyCurrentSignatureHelpParameterCount ( expectedCount : number ) {
@@ -861,7 +860,7 @@ module FourSlash {
861
860
this . taoInvalidReason = 'verifyCurrentSignatureHelpDocComment NYI' ;
862
861
863
862
var actualDocComment = this . getActiveSignatureHelpItem ( ) . documentation ;
864
- assert . equal ( actualDocComment , docComment ) ;
863
+ assert . equal ( ts . displayPartsToString ( actualDocComment ) , docComment , assertionMessage ( "current signature help doc comment" ) ) ;
865
864
}
866
865
867
866
public verifySignatureHelpCount ( expected : number ) {
@@ -1970,10 +1969,6 @@ module FourSlash {
1970
1969
this . taoInvalidReason = 'assertItemInCompletionList only supports the "name" parameter' ;
1971
1970
}
1972
1971
1973
- function assertionMessage ( msg : string ) {
1974
- return "\nMarker: " + currentTestState . lastKnownMarker + "\nChecking: " + msg + "\n\n" ;
1975
- }
1976
-
1977
1972
for ( var i = 0 ; i < items . length ; i ++ ) {
1978
1973
var item = items [ i ] ;
1979
1974
if ( item . name == name ) {
0 commit comments