1
- 'use strict' ;
1
+ 'use strict'
2
2
3
- var test = require ( 'tape' ) ;
4
- var stringify = require ( '.' ) ;
3
+ var test = require ( 'tape' )
4
+ var stringify = require ( '.' )
5
5
6
- test ( 'stringifyPosition' , function ( t ) {
7
- t . equal ( stringify ( ) , null , 'should return `null` with `undefined`' ) ;
8
- t . equal ( stringify ( null ) , null , 'should return `null` with `null`' ) ;
9
- t . equal ( stringify ( 'foo' ) , null , 'should return `null` with `string`' ) ;
10
- t . equal ( stringify ( 5 ) , null , 'should return `null` with `number`' ) ;
11
- t . equal ( stringify ( { } ) , null , 'should return `null` with `{}`' ) ;
6
+ test ( 'stringifyPosition' , function ( t ) {
7
+ t . equal ( stringify ( ) , null , 'should return `null` with `undefined`' )
8
+ t . equal ( stringify ( null ) , null , 'should return `null` with `null`' )
9
+ t . equal ( stringify ( 'foo' ) , null , 'should return `null` with `string`' )
10
+ t . equal ( stringify ( 5 ) , null , 'should return `null` with `number`' )
11
+ t . equal ( stringify ( { } ) , null , 'should return `null` with `{}`' )
12
12
13
13
t . equal (
14
14
stringify ( { type : 'text' } ) ,
15
15
'1:1-1:1' ,
16
16
'should return a range for a `node` without `position`'
17
- ) ;
17
+ )
18
18
19
19
t . equal (
20
20
stringify ( { type : 'text' , position : 3 } ) ,
21
21
'1:1-1:1' ,
22
22
'should return a range for `node` with invalid `position` #1'
23
- ) ;
23
+ )
24
24
25
25
t . equal (
26
26
stringify ( {
@@ -29,7 +29,7 @@ test('stringifyPosition', function (t) {
29
29
} ) ,
30
30
'1:1-1:1' ,
31
31
'should return a range for `node` with invalid `position` #2'
32
- ) ;
32
+ )
33
33
34
34
t . equal (
35
35
stringify ( {
@@ -41,7 +41,7 @@ test('stringifyPosition', function (t) {
41
41
} ) ,
42
42
'1:1-1:1' ,
43
43
'should return a range for `node` with invalid `position` #3'
44
- ) ;
44
+ )
45
45
46
46
t . equal (
47
47
stringify ( {
@@ -53,25 +53,25 @@ test('stringifyPosition', function (t) {
53
53
} ) ,
54
54
'2:5-2:6' ,
55
55
'should return a range for `node` with valid `position`'
56
- ) ;
56
+ )
57
57
58
58
t . equal (
59
59
stringify ( { start : null , end : null } ) ,
60
60
'1:1-1:1' ,
61
61
'should return a range for a `position` without `point`s'
62
- ) ;
62
+ )
63
63
64
64
t . equal (
65
65
stringify ( { start : 3 , end : 6 } ) ,
66
66
'1:1-1:1' ,
67
67
'should return a range for `position` with invalid `point`s #1'
68
- ) ;
68
+ )
69
69
70
70
t . equal (
71
71
stringify ( { start : { } , end : { } } ) ,
72
72
'1:1-1:1' ,
73
73
'should return range for `position` with invalid `point`s #1'
74
- ) ;
74
+ )
75
75
76
76
t . equal (
77
77
stringify ( {
@@ -80,7 +80,7 @@ test('stringifyPosition', function (t) {
80
80
} ) ,
81
81
'1:1-1:1' ,
82
82
'should return range for `position` with invalid `point`s #3'
83
- ) ;
83
+ )
84
84
85
85
t . equal (
86
86
stringify ( {
@@ -89,37 +89,37 @@ test('stringifyPosition', function (t) {
89
89
} ) ,
90
90
'2:5-2:6' ,
91
91
'should return range for `position` with valid `point`s'
92
- ) ;
92
+ )
93
93
94
94
t . equal (
95
95
stringify ( { line : null , column : null } ) ,
96
96
'1:1' ,
97
97
'should return a point for a `point` without indices'
98
- ) ;
98
+ )
99
99
100
100
t . equal (
101
101
stringify ( { line : 'foo' , column : 'bar' } ) ,
102
102
'1:1' ,
103
103
'should return a point for a `point` with invalid indices #1'
104
- ) ;
104
+ )
105
105
106
106
t . equal (
107
107
stringify ( { line : 4 } ) ,
108
108
'4:1' ,
109
109
'should return a point for a partially valid `point` #1'
110
- ) ;
110
+ )
111
111
112
112
t . equal (
113
113
stringify ( { column : 12 } ) ,
114
114
'1:12' ,
115
115
'should return a point for a partially valid `point` #1'
116
- ) ;
116
+ )
117
117
118
118
t . equal (
119
119
stringify ( { line : 5 , column : 2 } ) ,
120
120
'5:2' ,
121
121
'should return a point for a valid `point`'
122
- ) ;
122
+ )
123
123
124
- t . end ( ) ;
125
- } ) ;
124
+ t . end ( )
125
+ } )
0 commit comments