@@ -10,7 +10,7 @@ var inspect
10
10
try {
11
11
// eslint-disable-next-line import/no-dynamic-require, no-useless-concat
12
12
inspect = require ( 'ut' + 'il' ) . inspect
13
- } catch ( err ) {
13
+ } catch ( error ) {
14
14
/* Empty. */
15
15
}
16
16
@@ -37,18 +37,18 @@ function wrap(fn) {
37
37
function wrapped ( node , parent ) {
38
38
try {
39
39
fn ( node , parent )
40
- } catch ( err ) {
41
- if ( ! err [ ID ] ) {
42
- err [ ID ] = true
40
+ } catch ( error ) {
41
+ if ( ! error [ ID ] ) {
42
+ error [ ID ] = true
43
43
44
- err . message += ': `' + view ( node ) + '`'
44
+ error . message += ': `' + view ( node ) + '`'
45
45
46
46
if ( parent ) {
47
- err . message += ' in `' + view ( parent ) + '`'
47
+ error . message += ' in `' + view ( parent ) + '`'
48
48
}
49
49
}
50
50
51
- throw err
51
+ throw error
52
52
}
53
53
}
54
54
}
@@ -69,11 +69,11 @@ function unist(node) {
69
69
value = node . value
70
70
71
71
assert . ok ( 'type' in node , 'node should have a type' )
72
- assert . equal ( typeof type , 'string' , '`type` should be a string' )
73
- assert . notEqual ( type , '' , '`type` should not be empty' )
72
+ assert . strictEqual ( typeof type , 'string' , '`type` should be a string' )
73
+ assert . notStrictEqual ( type , '' , '`type` should not be empty' )
74
74
75
75
if ( value != null ) {
76
- assert . equal ( typeof value , 'string' , '`value` should be a string' )
76
+ assert . strictEqual ( typeof value , 'string' , '`value` should be a string' )
77
77
}
78
78
79
79
location ( node . position )
@@ -99,9 +99,9 @@ function unist(node) {
99
99
* and re-parsed to the same (deep) value. */
100
100
function vanilla ( key , value ) {
101
101
try {
102
- assert . deepEqual ( value , JSON . parse ( JSON . stringify ( value ) ) )
103
- } catch ( err ) {
104
- assert . fail ( '' , '' , ' non-specced property `' + key + '` should be JSON' )
102
+ assert . deepStrictEqual ( value , JSON . parse ( JSON . stringify ( value ) ) )
103
+ } catch ( error ) {
104
+ assert . fail ( 'non-specced property `' + key + '` should be JSON' )
105
105
}
106
106
}
107
107
@@ -117,7 +117,7 @@ function view(value) {
117
117
} else {
118
118
return JSON . stringify ( value )
119
119
}
120
- } catch ( err ) {
120
+ } catch ( error ) {
121
121
/* istanbul ignore next - Cyclical. */
122
122
return String ( value )
123
123
}
@@ -127,15 +127,19 @@ function view(value) {
127
127
function parent ( node ) {
128
128
unist ( node )
129
129
130
- assert . equal ( 'value' in node , false , 'parent should not have `value`' )
130
+ assert . strictEqual ( 'value' in node , false , 'parent should not have `value`' )
131
131
assert . ok ( 'children' in node , 'parent should have `children`' )
132
132
}
133
133
134
134
/* Assert `node` is a text node. */
135
135
function text ( node ) {
136
136
unist ( node )
137
137
138
- assert . equal ( 'children' in node , false , 'text should not have `children`' )
138
+ assert . strictEqual (
139
+ 'children' in node ,
140
+ false ,
141
+ 'text should not have `children`'
142
+ )
139
143
assert . ok ( 'value' in node , 'text should have `value`' )
140
144
}
141
145
@@ -144,8 +148,12 @@ function text(node) {
144
148
function empty ( node ) {
145
149
unist ( node )
146
150
147
- assert . equal ( 'value' in node , false , 'void should not have `value`' )
148
- assert . equal ( 'children' in node , false , 'void should not have `children`' )
151
+ assert . strictEqual ( 'value' in node , false , 'void should not have `value`' )
152
+ assert . strictEqual (
153
+ 'children' in node ,
154
+ false ,
155
+ 'void should not have `children`'
156
+ )
149
157
}
150
158
151
159
/* Assert `location` is a Unist Location. */
0 commit comments