@@ -14,8 +14,11 @@ test('removePosition', async function (t) {
1414 await t . test ( 'should work softly' , async function ( ) {
1515 const empty = { position : undefined }
1616
17+ const root = fromMarkdown ( 'Some **strong**, _emphasis_, and `code`.' )
18+ removePosition ( root )
19+
1720 assert . deepEqual (
18- removePosition ( fromMarkdown ( 'Some **strong**, _emphasis_, and `code`.' ) ) ,
21+ root ,
1922 u ( 'root' , empty , [
2023 u ( 'paragraph' , empty , [
2124 u ( 'text' , empty , 'Some ' ) ,
@@ -31,10 +34,12 @@ test('removePosition', async function (t) {
3134 } )
3235
3336 await t . test ( 'should work by force' , async function ( ) {
37+ const root = fromMarkdown ( 'Some **strong**, _emphasis_, and `code`.' )
38+
39+ removePosition ( root , { force : true } )
40+
3441 assert . deepEqual (
35- removePosition ( fromMarkdown ( 'Some **strong**, _emphasis_, and `code`.' ) , {
36- force : true
37- } ) ,
42+ root ,
3843 u ( 'root' , [
3944 u ( 'paragraph' , [
4045 u ( 'text' , 'Some ' ) ,
@@ -50,9 +55,9 @@ test('removePosition', async function (t) {
5055 } )
5156
5257 await t . test ( 'should support options' , async function ( ) {
53- assert . deepEqual (
54- removePosition ( fromMarkdown ( 'x' ) , { force : true } ) ,
55- u ( 'root' , [ u ( 'paragraph' , [ u ( 'text' , 'x' ) ] ) ] )
56- )
58+ const root = fromMarkdown ( 'x' )
59+ removePosition ( root , { force : true } )
60+
61+ assert . deepEqual ( root , u ( 'root' , [ u ( 'paragraph' , [ u ( 'text' , 'x' ) ] ) ] ) )
5762 } )
5863} )
0 commit comments