@@ -4,7 +4,7 @@ var test = require('tape')
4
4
var u = require ( 'unist-builder' )
5
5
var remove = require ( '.' )
6
6
7
- test ( 'should compare nodes by partial properties' , function ( t ) {
7
+ test ( 'should compare nodes by partial properties' , function ( t ) {
8
8
var tree = u ( 'node' , [ u ( 'leaf' , '1' ) , u ( 'leaf' , '2' ) ] )
9
9
var children = tree . children
10
10
var first = tree . children [ 0 ]
@@ -19,7 +19,7 @@ test('should compare nodes by partial properties', function(t) {
19
19
t . end ( )
20
20
} )
21
21
22
- test ( 'should remove nodes with children' , function ( t ) {
22
+ test ( 'should remove nodes with children' , function ( t ) {
23
23
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
24
24
var children = tree . children
25
25
var first = tree . children [ 0 ]
@@ -39,15 +39,15 @@ test('should remove nodes with children', function(t) {
39
39
}
40
40
} )
41
41
42
- test ( 'should return `null` if root node is removed' , function ( t ) {
42
+ test ( 'should return `null` if root node is removed' , function ( t ) {
43
43
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
44
44
45
45
t . equal ( remove ( tree , 'root' ) , null )
46
46
47
47
t . end ( )
48
48
} )
49
49
50
- test ( 'should cascade-remove parent nodes' , function ( t ) {
50
+ test ( 'should cascade-remove parent nodes' , function ( t ) {
51
51
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
52
52
var children = tree . children
53
53
var first = children [ 0 ] . children [ 0 ]
@@ -67,7 +67,7 @@ test('should cascade-remove parent nodes', function(t) {
67
67
}
68
68
} )
69
69
70
- test ( 'should cascade-remove root nodes' , function ( t ) {
70
+ test ( 'should cascade-remove root nodes' , function ( t ) {
71
71
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
72
72
73
73
var next = remove ( tree , 'leaf' )
@@ -77,7 +77,7 @@ test('should cascade-remove root nodes', function(t) {
77
77
t . end ( )
78
78
} )
79
79
80
- test ( 'should not cascade-remove nodes that were empty initially' , function ( t ) {
80
+ test ( 'should not cascade-remove nodes that were empty initially' , function ( t ) {
81
81
var tree = u ( 'node' , [ u ( 'node' , [ ] ) , u ( 'node' , [ u ( 'leaf' ) ] ) ] )
82
82
83
83
remove ( tree , 'leaf' )
@@ -87,7 +87,7 @@ test('should not cascade-remove nodes that were empty initially', function(t) {
87
87
t . end ( )
88
88
} )
89
89
90
- test ( 'should support type tests' , function ( t ) {
90
+ test ( 'should support type tests' , function ( t ) {
91
91
var tree = u ( 'node' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
92
92
93
93
remove ( tree , { cascade : false } , 'leaf' )
@@ -97,7 +97,7 @@ test('should support type tests', function(t) {
97
97
t . end ( )
98
98
} )
99
99
100
- test ( 'should support function tests' , function ( t ) {
100
+ test ( 'should support function tests' , function ( t ) {
101
101
var tree = u ( 'node' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
102
102
103
103
remove ( tree , { cascade : false } , test )
@@ -111,7 +111,7 @@ test('should support function tests', function(t) {
111
111
}
112
112
} )
113
113
114
- test ( 'opts.cascade = true' , function ( t ) {
114
+ test ( 'opts.cascade = true' , function ( t ) {
115
115
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
116
116
117
117
var next = remove ( tree , { cascade : true } , 'leaf' )
@@ -121,7 +121,7 @@ test('opts.cascade = true', function(t) {
121
121
t . end ( )
122
122
} )
123
123
124
- test ( 'opts.cascade = false' , function ( t ) {
124
+ test ( 'opts.cascade = false' , function ( t ) {
125
125
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
126
126
var siblings = tree . children
127
127
var node = siblings [ 0 ]
@@ -138,7 +138,7 @@ test('opts.cascade = false', function(t) {
138
138
t . end ( )
139
139
} )
140
140
141
- test ( 'example from readme' , function ( t ) {
141
+ test ( 'example from readme' , function ( t ) {
142
142
var tree = u ( 'root' , [
143
143
u ( 'leaf' , '1' ) ,
144
144
u ( 'node' , [
0 commit comments