@@ -4,7 +4,7 @@ var test = require('tape')
4
4
var u = require ( 'unist-builder' )
5
5
var filter = require ( '.' )
6
6
7
- test ( 'should not traverse into children of filtered out nodes' , function ( t ) {
7
+ test ( 'should not traverse into children of filtered out nodes' , function ( t ) {
8
8
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
9
9
var types = { }
10
10
@@ -19,7 +19,7 @@ test('should not traverse into children of filtered out nodes', function(t) {
19
19
}
20
20
} )
21
21
22
- test ( 'should return `null` if root node is filtered out' , function ( t ) {
22
+ test ( 'should return `null` if root node is filtered out' , function ( t ) {
23
23
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
24
24
25
25
t . deepEqual ( filter ( tree , predicate ) , null )
@@ -31,7 +31,7 @@ test('should return `null` if root node is filtered out', function(t) {
31
31
}
32
32
} )
33
33
34
- test ( 'should cascade-remove parent nodes' , function ( t ) {
34
+ test ( 'should cascade-remove parent nodes' , function ( t ) {
35
35
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
36
36
37
37
t . deepEqual ( filter ( tree , notOne ) , u ( 'root' , [ u ( 'leaf' , '2' ) ] ) )
@@ -48,15 +48,15 @@ test('should cascade-remove parent nodes', function(t) {
48
48
}
49
49
} )
50
50
51
- test ( 'should not cascade-remove nodes that were empty initially' , function ( t ) {
51
+ test ( 'should not cascade-remove nodes that were empty initially' , function ( t ) {
52
52
var tree = u ( 'node' , [ u ( 'node' , [ ] ) , u ( 'node' , [ u ( 'leaf' ) ] ) ] )
53
53
54
54
t . deepEqual ( filter ( tree , 'node' ) , u ( 'node' , [ u ( 'node' , [ ] ) ] ) )
55
55
56
56
t . end ( )
57
57
} )
58
58
59
- test ( 'should call iterator with `index` and `parent` args' , function ( t ) {
59
+ test ( 'should call iterator with `index` and `parent` args' , function ( t ) {
60
60
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
61
61
var callLog = [ ]
62
62
@@ -77,7 +77,7 @@ test('should call iterator with `index` and `parent` args', function(t) {
77
77
}
78
78
} )
79
79
80
- test ( 'should support type and node tests' , function ( t ) {
80
+ test ( 'should support type and node tests' , function ( t ) {
81
81
var tree = u ( 'node' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
82
82
83
83
t . deepEqual ( filter ( tree , 'node' ) , null )
@@ -90,7 +90,7 @@ test('should support type and node tests', function(t) {
90
90
t . end ( )
91
91
} )
92
92
93
- test ( 'opts.cascade' , function ( t ) {
93
+ test ( 'opts.cascade' , function ( t ) {
94
94
var tree = u ( 'root' , [ u ( 'node' , [ u ( 'leaf' , '1' ) ] ) , u ( 'leaf' , '2' ) ] )
95
95
96
96
t . deepEqual (
@@ -112,7 +112,7 @@ test('opts.cascade', function(t) {
112
112
}
113
113
} )
114
114
115
- test ( 'example from README' , function ( t ) {
115
+ test ( 'example from README' , function ( t ) {
116
116
var tree = u ( 'root' , [
117
117
u ( 'leaf' , '1' ) ,
118
118
u ( 'node' , [ u ( 'leaf' , '2' ) , u ( 'node' , [ u ( 'leaf' , '3' ) ] ) ] ) ,
0 commit comments