Skip to content

Commit c92e4a2

Browse files
committed
Fix tests for changes in @types/unist
1 parent 3b947fd commit c92e4a2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @typedef {import('unist').Node} Node
3+
* @typedef {import('unist').Literal<string>} Literal
34
* @typedef {import('unist').Parent} Parent
45
*/
56

@@ -44,7 +45,7 @@ function mergeEmoticons(child, index, parent) {
4445
var siblingIndex
4546
/** @type {Node} */
4647
var node
47-
/** @type {Node} */
48+
/** @type {Literal} */
4849
var emoticonNode
4950

5051
// Check if `child`s first character could be used to start an emoticon.

test/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* @typedef {import('unist').Node} Node
3+
* @typedef {import('unist').Literal<string>} Literal
34
*/
45

56
import fs from 'fs'
@@ -69,7 +70,7 @@ test('emoticons', function (t) {
6970
var list
7071
/** @type {Node} */
7172
var tree
72-
/** @type {Node} */
73+
/** @type {Literal} */
7374
var node
7475

7576
while (++index < emoticon.length) {
@@ -80,6 +81,7 @@ test('emoticons', function (t) {
8081
tree = position.runSync(
8182
position.parse('Who doesn’t like ' + list[offset] + '?')
8283
)
84+
// @ts-expect-error: hush
8385
node = tree.children[0].children[0].children[6]
8486

8587
t.strictEqual(node.type, 'EmoticonNode', list[offset] + ' type')

0 commit comments

Comments
 (0)