|
2 | 2 |
|
3 | 3 | var test = require('tape') |
4 | 4 | var u = require('unist-builder') |
5 | | -var select = require('unist-util-select') |
6 | 5 | var filter = require('.') |
7 | 6 |
|
8 | 7 | test('should not traverse into children of filtered out nodes', function(t) { |
@@ -64,18 +63,14 @@ test('should call iterator with `index` and `parent` args', function(t) { |
64 | 63 | t.deepEqual(filter(tree, predicate), tree) |
65 | 64 |
|
66 | 65 | t.deepEqual(callLog, [ |
67 | | - [$('root'), null, null], |
68 | | - [$('node'), 0, $('root')], |
69 | | - [$('node > leaf'), 0, $('node')], |
70 | | - [$('node + leaf'), 1, $('root')] |
| 66 | + [tree, null, null], |
| 67 | + [tree.children[0], 0, tree], |
| 68 | + [tree.children[0].children[0], 0, tree.children[0]], |
| 69 | + [tree.children[1], 1, tree] |
71 | 70 | ]) |
72 | 71 |
|
73 | 72 | t.end() |
74 | 73 |
|
75 | | - function $() { |
76 | | - return select.bind(null, tree).apply(this, arguments)[0] |
77 | | - } |
78 | | - |
79 | 74 | function predicate() { |
80 | 75 | callLog.push([].slice.call(arguments)) |
81 | 76 | return true |
|
0 commit comments