@@ -9,17 +9,17 @@ var tree = remark().parse('Some *emphasis*, **importance**, and `code`.')
99var paragraph = tree . children [ 0 ]
1010var children = paragraph . children
1111
12- test ( 'unist-util-find-before' , function ( t ) {
12+ test ( 'unist-util-find-before' , function ( t ) {
1313 t . throws (
14- function ( ) {
14+ function ( ) {
1515 findBefore ( )
1616 } ,
1717 / E x p e c t e d p a r e n t n o d e / ,
1818 'should fail without parent'
1919 )
2020
2121 t . throws (
22- function ( ) {
22+ function ( ) {
2323 findBefore ( {
2424 type : 'foo'
2525 } )
@@ -28,22 +28,22 @@ test('unist-util-find-before', function(t) {
2828 'should fail without parent node'
2929 )
3030
31- t . doesNotThrow ( function ( ) {
32- assert . throws ( function ( ) {
31+ t . doesNotThrow ( function ( ) {
32+ assert . throws ( function ( ) {
3333 findBefore ( { type : 'foo' , children : [ ] } )
3434 } , / E x p e c t e d p o s i t i v e f i n i t e i n d e x o r c h i l d n o d e / )
3535
36- assert . throws ( function ( ) {
36+ assert . throws ( function ( ) {
3737 findBefore ( { type : 'foo' , children : [ ] } , - 1 )
3838 } , / E x p e c t e d p o s i t i v e f i n i t e i n d e x o r c h i l d n o d e / )
3939
40- assert . throws ( function ( ) {
40+ assert . throws ( function ( ) {
4141 findBefore ( { type : 'foo' , children : [ ] } , { type : 'bar' } )
4242 } , / E x p e c t e d p o s i t i v e f i n i t e i n d e x o r c h i l d n o d e / )
4343 } , 'should fail without index' )
4444
45- t . doesNotThrow ( function ( ) {
46- assert . throws ( function ( ) {
45+ t . doesNotThrow ( function ( ) {
46+ assert . throws ( function ( ) {
4747 findBefore (
4848 {
4949 type : 'foo' ,
@@ -54,7 +54,7 @@ test('unist-util-find-before', function(t) {
5454 )
5555 } , / E x p e c t e d f u n c t i o n , s t r i n g , o r o b j e c t a s t e s t / )
5656
57- assert . throws ( function ( ) {
57+ assert . throws ( function ( ) {
5858 findBefore (
5959 {
6060 type : 'foo' ,
@@ -66,13 +66,13 @@ test('unist-util-find-before', function(t) {
6666 } , / E x p e c t e d f u n c t i o n , s t r i n g , o r o b j e c t a s t e s t / )
6767 } , 'should fail for invalid `test`' )
6868
69- t . doesNotThrow ( function ( ) {
69+ t . doesNotThrow ( function ( ) {
7070 assert . strictEqual ( findBefore ( paragraph , children [ 1 ] ) , children [ 0 ] )
7171 assert . strictEqual ( findBefore ( paragraph , 1 ) , children [ 0 ] )
7272 assert . strictEqual ( findBefore ( paragraph , 0 ) , null )
7373 } , 'should return the preceding node when without `test`' )
7474
75- t . doesNotThrow ( function ( ) {
75+ t . doesNotThrow ( function ( ) {
7676 assert . strictEqual ( findBefore ( paragraph , 100 , children [ 0 ] ) , children [ 0 ] )
7777 assert . strictEqual (
7878 findBefore ( paragraph , children [ 1 ] , children [ 0 ] ) ,
@@ -84,7 +84,7 @@ test('unist-util-find-before', function(t) {
8484 assert . strictEqual ( findBefore ( paragraph , 1 , children [ 1 ] ) , null )
8585 } , 'should return `node` when given a `node` and existing' )
8686
87- t . doesNotThrow ( function ( ) {
87+ t . doesNotThrow ( function ( ) {
8888 assert . strictEqual ( findBefore ( paragraph , 100 , 'strong' ) , children [ 3 ] )
8989 assert . strictEqual ( findBefore ( paragraph , 3 , 'strong' ) , null )
9090 assert . strictEqual (
@@ -94,7 +94,7 @@ test('unist-util-find-before', function(t) {
9494 assert . strictEqual ( findBefore ( paragraph , children [ 3 ] , 'strong' ) , null )
9595 } , 'should return a child when given a `type` and existing' )
9696
97- t . doesNotThrow ( function ( ) {
97+ t . doesNotThrow ( function ( ) {
9898 assert . strictEqual ( findBefore ( paragraph , 100 , test ) , children [ 3 ] )
9999 assert . strictEqual ( findBefore ( paragraph , 3 , test ) , null )
100100 assert . strictEqual ( findBefore ( paragraph , children [ 4 ] , test ) , children [ 3 ] )
0 commit comments