Skip to content

Commit

Permalink
Update tests for changes in @types/unist
Browse files Browse the repository at this point in the history
Reviewed-by: Christian Murphy <[email protected]>
Reviewed-by: Titus Wormer <[email protected]>

Closes GH-28.
  • Loading branch information
GuiltyDolphin authored Jul 6, 2021
1 parent 0d24628 commit 3b197e4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* @typedef {import('unist').Literal} Literal
* @typedef {import('unist').Node} Node
* @typedef {import('unist').Parent} Parent
*/
Expand Down Expand Up @@ -183,7 +184,7 @@ test('unist-util-visit', function (t) {
st.end()

/**
* @param {Node} node
* @param {Literal} node
*/
function visitor(node) {
var ok = expected.has(node.type) || node.value === '.'
Expand Down Expand Up @@ -435,7 +436,14 @@ test('unist-util-visit', function (t) {

t.test('should visit added nodes', function (st) {
var tree = remark().parse('Some _emphasis_, **importance**, and `code`.')
var other = remark().use(gfm).parse('Another ~~sentence~~.').children[0]

// Unified doesn't know parse result type,
// all we know is that it's a node, but we know it is a parent, so we
// assert that here
var other = /** @type{Parent} */ (
remark().use(gfm).parse('Another ~~sentence~~.')
).children[0]

var l = types.length + 5 // (p, text, delete, text, text)
var n = 0

Expand Down

0 comments on commit 3b197e4

Please sign in to comment.