Skip to content

Commit

Permalink
Remove unneeded explicit types in tests
Browse files Browse the repository at this point in the history
Maybe updating `types/unist` will solve it?

Related-to: #216.
  • Loading branch information
wooorm committed Aug 9, 2023
1 parent 3f56f0f commit 250d3e5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
"atLeast": 100,
"detail": true,
"strict": true,
"#": "`type-coverage` currently barfs on inferring nodes in plugins, while TS gets it",
"ignoreFiles": [
"test/**/*"
],
"ignoreCatch": true
}
}
9 changes: 0 additions & 9 deletions test/process.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @typedef {import('unist').Literal<string>} Literal
* @typedef {import('unist').Node} Node
* @typedef {import('../index.js').Parser} Parser
* @typedef {import('../index.js').Compiler} Compiler
*/
Expand Down Expand Up @@ -47,10 +46,6 @@ test('process(file, done)', () => {
})
.use(
() =>
/**
* @param {Node} tree
* @param {VFile} file
*/
function (tree, file) {
assert.equal(tree, givenNode, 'should pass `tree` to transformers')
assert.equal(file, givenFile, 'should pass `file` to transformers')
Expand Down Expand Up @@ -104,10 +99,6 @@ test('process(file)', () => {
})
.use(
() =>
/**
* @param {Node} tree
* @param {VFile} file
*/
function (tree, file) {
assert.equal(tree, givenNode, 'should pass `tree` to transformers')
assert.equal(file, givenFile, 'should pass `file` to transformers')
Expand Down
12 changes: 0 additions & 12 deletions test/run.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* @typedef {import('unist').Node} Node
*/

import process from 'node:process'
import assert from 'node:assert/strict'
import test from 'node:test'
Expand Down Expand Up @@ -553,10 +549,6 @@ test('runSync(node[, file])', async () => {
unified()
.use(
() =>
/**
* @param {Node} tree
* @param {VFile} file
*/
function (tree, file) {
assert.equal(tree, givenNode, 'passes given tree to transformers')
assert.equal(file, givenFile, 'passes given file to transformers')
Expand All @@ -567,10 +559,6 @@ test('runSync(node[, file])', async () => {
unified()
.use(
() =>
/**
* @param {Node} _
* @param {VFile} file
*/
function (_, file) {
assert.equal(
file.toString(),
Expand Down
9 changes: 0 additions & 9 deletions test/use.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* @typedef {import('unist').Node} Node
* @typedef {import('vfile').VFile} VFile
*/

import assert from 'node:assert/strict'
import test from 'node:test'
import {unified} from '../index.js'
Expand Down Expand Up @@ -259,10 +254,6 @@ test('use(plugin[, options])', async (t) => {
processor
.use(
() =>
/**
* @param {Node} node
* @param {VFile} file
*/
function (node, file) {
assert.equal(node, givenNode, 'should attach a transformer (#1)')
assert.ok('message' in file, 'should attach a transformer (#2)')
Expand Down

0 comments on commit 250d3e5

Please sign in to comment.