@@ -14,8 +14,11 @@ test('removePosition', async function (t) {
14
14
await t . test ( 'should work softly' , async function ( ) {
15
15
const empty = { position : undefined }
16
16
17
+ const root = fromMarkdown ( 'Some **strong**, _emphasis_, and `code`.' )
18
+ removePosition ( root )
19
+
17
20
assert . deepEqual (
18
- removePosition ( fromMarkdown ( 'Some **strong**, _emphasis_, and `code`.' ) ) ,
21
+ root ,
19
22
u ( 'root' , empty , [
20
23
u ( 'paragraph' , empty , [
21
24
u ( 'text' , empty , 'Some ' ) ,
@@ -31,10 +34,12 @@ test('removePosition', async function (t) {
31
34
} )
32
35
33
36
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
+
34
41
assert . deepEqual (
35
- removePosition ( fromMarkdown ( 'Some **strong**, _emphasis_, and `code`.' ) , {
36
- force : true
37
- } ) ,
42
+ root ,
38
43
u ( 'root' , [
39
44
u ( 'paragraph' , [
40
45
u ( 'text' , 'Some ' ) ,
@@ -50,9 +55,9 @@ test('removePosition', async function (t) {
50
55
} )
51
56
52
57
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' ) ] ) ] ) )
57
62
} )
58
63
} )
0 commit comments