@@ -26,42 +26,42 @@ test('source', async function (t) {
2626 assert ( text . type === 'text' )
2727
2828 await t . test ( 'should support a root' , async function ( ) {
29- assert . equal ( source ( tree , file ) , '> + **[Hello](./example)**\n> world.' )
29+ assert . equal ( source ( file , tree ) , '> + **[Hello](./example)**\n> world.' )
3030 } )
3131
3232 await t . test ( 'should support a block quote' , async function ( ) {
3333 assert . equal (
34- source ( blockquote , file ) ,
34+ source ( file , blockquote ) ,
3535 '> + **[Hello](./example)**\n> world.'
3636 )
3737 } )
3838
3939 await t . test ( 'should support a list' , async function ( ) {
40- assert . equal ( source ( list , file ) , '+ **[Hello](./example)**\n> world.' )
40+ assert . equal ( source ( file , list ) , '+ **[Hello](./example)**\n> world.' )
4141 } )
4242
4343 await t . test ( 'should support a list item' , async function ( ) {
44- assert . equal ( source ( listItem , file ) , '+ **[Hello](./example)**\n> world.' )
44+ assert . equal ( source ( file , listItem ) , '+ **[Hello](./example)**\n> world.' )
4545 } )
4646
4747 await t . test ( 'should support a paragraph' , async function ( ) {
48- assert . equal ( source ( paragraph , file ) , '**[Hello](./example)**\n> world.' )
48+ assert . equal ( source ( file , paragraph ) , '**[Hello](./example)**\n> world.' )
4949 } )
5050
5151 await t . test ( 'should support strong' , async function ( ) {
52- assert . equal ( source ( strong , file ) , '**[Hello](./example)**' )
52+ assert . equal ( source ( file , strong ) , '**[Hello](./example)**' )
5353 } )
5454
5555 await t . test ( 'should support a link' , async function ( ) {
56- assert . equal ( source ( link , file ) , '[Hello](./example)' )
56+ assert . equal ( source ( file , link ) , '[Hello](./example)' )
5757 } )
5858
5959 await t . test ( 'should support a text' , async function ( ) {
60- assert . equal ( source ( text , file ) , 'Hello' )
60+ assert . equal ( source ( file , text ) , 'Hello' )
6161 } )
6262
6363 await t . test ( 'should support a position' , async function ( ) {
64- assert . equal ( source ( text . position , file ) , 'Hello' )
64+ assert . equal ( source ( file , text . position ) , 'Hello' )
6565 } )
6666
6767 await t . test ( 'should support out of bounds data' , async function ( ) {
@@ -70,44 +70,44 @@ test('source', async function (t) {
7070 value : 'qwe' ,
7171 position : { start : { line : 0 , column : 0 } , end : { line : 0 , column : 0 } }
7272 }
73- assert . equal ( source ( text , file ) , undefined )
73+ assert . equal ( source ( file , text ) , undefined )
7474 } )
7575
7676 await t . test ( 'should support a generated node' , async function ( ) {
7777 const text = { type : 'text' , value : 'qwe' }
78- assert . equal ( source ( text , file ) , undefined )
78+ assert . equal ( source ( file , text ) , undefined )
7979 } )
8080
8181 await t . test ( 'should support a nullish node' , async function ( ) {
82- assert . equal ( source ( null , file ) , undefined )
82+ assert . equal ( source ( file , null ) , undefined )
8383 } )
8484
8585 await t . test ( 'should support cr + lf' , async function ( ) {
8686 const file = new VFile ( 'a\r\nb' )
8787 const node = fromMarkdown ( String ( file ) )
8888 const paragraph = node . children [ 0 ]
89- assert . equal ( source ( paragraph , file ) , 'a\r\nb' )
89+ assert . equal ( source ( file , paragraph ) , 'a\r\nb' )
9090 } )
9191
9292 await t . test ( 'should support cr' , async function ( ) {
9393 const file = new VFile ( 'a\rb' )
9494 const node = fromMarkdown ( String ( file ) )
9595 const paragraph = node . children [ 0 ]
9696
97- assert . equal ( source ( paragraph , file ) , 'a\rb' )
97+ assert . equal ( source ( file , paragraph ) , 'a\rb' )
9898 } )
9999
100100 await t . test ( 'should support an eof eol' , async function ( ) {
101101 const file = new VFile ( 'a\n' )
102102 const node = fromMarkdown ( String ( file ) )
103103
104- assert . equal ( source ( node , file ) , 'a\n' )
104+ assert . equal ( source ( file , node ) , 'a\n' )
105105 } )
106106
107107 await t . test ( 'should support an lf + cr (a blank line)' , async function ( ) {
108108 const file = new VFile ( 'a\n\rb' )
109109 const node = fromMarkdown ( String ( file ) )
110110
111- assert . equal ( source ( node , file ) , 'a\n\rb' )
111+ assert . equal ( source ( file , node ) , 'a\n\rb' )
112112 } )
113113} )
0 commit comments