Skip to content

Commit cee53f3

Browse files
committed
Update dev-dependencies
1 parent 76c0e0b commit cee53f3

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"tape": "^5.0.0",
3939
"tinyify": "^3.0.0",
4040
"unist-util-visit": "^2.0.0",
41-
"xo": "^0.35.0"
41+
"xo": "^0.38.0"
4242
},
4343
"scripts": {
4444
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",

test.js

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test('isLiteral()', function (t) {
5151
}, 'should work on single word sentences')
5252

5353
t.doesNotThrow(function () {
54-
;[
54+
var fixtures = [
5555
'Foo - is meant as a literal.',
5656
'Foo – is meant as a literal.',
5757
'Foo — is meant as a literal.',
@@ -61,15 +61,18 @@ test('isLiteral()', function (t) {
6161
'Foo—is meant as a literal.',
6262
'Foo: is meant as a literal.',
6363
'Foo; is meant as a literal.'
64-
].forEach(function (fixture) {
65-
process(fixture, function (node, index, parent) {
66-
assert.strictEqual(isLiteral(parent, index), index === 0, fixture)
64+
]
65+
var index = -1
66+
67+
while (++index < fixtures.length) {
68+
process(fixtures[index], function (node, index, parent) {
69+
assert.strictEqual(isLiteral(parent, index), index === 0, index)
6770
})
68-
})
71+
}
6972
}, 'Initial')
7073

7174
t.doesNotThrow(function () {
72-
;[
75+
var fixtures = [
7376
'Meant as a literal is - foo.',
7477
'Meant as a literal is – foo.',
7578
'Meant as a literal is — foo.',
@@ -79,19 +82,22 @@ test('isLiteral()', function (t) {
7982
'Meant as a literal is—foo.',
8083
'Meant as a literal is: foo.',
8184
'Meant as a literal is; foo.'
82-
].forEach(function (fixture) {
83-
process(fixture, function (node, index, parent) {
85+
]
86+
var index = -1
87+
88+
while (++index < fixtures.length) {
89+
process(fixtures[index], function (node, index, parent) {
8490
assert.strictEqual(
8591
isLiteral(parent, index),
8692
index === parent.children.length - 2,
87-
fixture
93+
index
8894
)
8995
})
90-
})
96+
}
9197
}, 'Final')
9298

9399
t.doesNotThrow(function () {
94-
;[
100+
var fixtures = [
95101
'The word, foo, is meant as a literal.',
96102
'The word -foo- is meant as a literal.',
97103
'The word –foo– is meant as a literal.',
@@ -118,23 +124,26 @@ test('isLiteral()', function (t) {
118124
'The word {foo} is meant as a literal.',
119125
'The word ⟨foo⟩ is meant as a literal.',
120126
'The word 「foo」 is meant as a literal.'
121-
].forEach(function (fixture, n) {
122-
process(fixture, function (node, index, parent) {
127+
]
128+
var index = -1
129+
130+
while (++index < fixtures.length) {
131+
process(fixtures[index], function (node, place, parent) {
123132
var pos = 5
124133

125134
// Adjacent hyphens are part of the word.
126-
if (n === 1) {
135+
if (index === 1) {
127136
pos = 4
128137
}
129138

130139
// Tests for extra spaces.
131-
if (n === 4 || n === 5 || n === 6) {
140+
if (index === 4 || index === 5 || index === 6) {
132141
pos = 6
133142
}
134143

135-
assert.strictEqual(isLiteral(parent, index), index === pos, fixture)
144+
assert.strictEqual(isLiteral(parent, place), place === pos, index)
136145
})
137-
})
146+
}
138147
}, 'Internal')
139148

140149
t.end()

0 commit comments

Comments
 (0)