@@ -7,49 +7,44 @@ test('mdast-util-to-string', function(t) {
77 t . equal ( toString ( ) , '' , 'should not fail on a missing node' )
88 t . equal ( toString ( null ) , '' , 'should not fail on `null` missing node' )
99
10- t . equal (
11- toString ( { value : 'foo' } ) ,
12- 'foo' ,
13- 'should not fail on unrecognised nodes'
14- )
10+ t . equal ( toString ( { value : 'foo' } ) , 'foo' , 'should not fail on nodes w/o type' )
1511
1612 t . equal (
1713 toString ( {
1814 value : 'foo' ,
19- children : [ { value : 'foo' } , { alt : 'bar' } , { title : 'baz' } ]
15+ alt : 'bar' ,
16+ title : 'baz' ,
17+ children : [ { value : 'qux' } ]
2018 } ) ,
2119 'foo' ,
2220 'should prefer `value` over all others'
2321 )
2422
2523 t . equal (
26- toString ( { value : 'foo' , alt : 'bar' , title : 'baz' } ) ,
27- 'foo' ,
28- 'should prefer `value` over `alt` or `title`'
29- )
30-
31- t . equal (
32- toString ( { alt : 'bar' , title : 'baz' } ) ,
24+ toString ( { alt : 'bar' , title : 'baz' , children : [ { value : 'qux' } ] } ) ,
3325 'bar' ,
34- 'should prefer `alt` over `title` '
26+ 'should prefer `alt` over all others '
3527 )
3628
3729 t . equal (
38- toString ( {
39- title : 'baz' ,
40- children : [ { value : 'foo' } , { alt : 'bar' } , { title : 'baz' } ]
41- } ) ,
30+ toString ( { title : 'baz' , children : [ { value : 'qux' } ] } ) ,
4231 'baz' ,
43- 'should use `title` over `children` '
32+ 'should prefer `title` over all others '
4433 )
4534
4635 t . equal (
4736 toString ( { children : [ { value : 'foo' } , { alt : 'bar' } , { title : 'baz' } ] } ) ,
4837 'foobarbaz' ,
49- 'should prefer `children`'
38+ 'should serialize children'
39+ )
40+
41+ t . equal (
42+ toString ( [ { value : 'foo' } , { alt : 'bar' } , { title : 'baz' } ] ) ,
43+ 'foobarbaz' ,
44+ 'should serialize a list of nodes'
5045 )
5146
52- t . equal ( toString ( { } ) , '' , 'should fall back on an empty string' )
47+ t . equal ( toString ( { } ) , '' , 'should produce an empty string otherwise ' )
5348
5449 t . end ( )
5550} )
0 commit comments