Skip to content

Commit

Permalink
Update xo
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 21, 2021
1 parent 591b0c0 commit 3d50462
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 212 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"tsd": "^0.17.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.39.0"
"xo": "^0.42.0"
},
"scripts": {
"build": "rimraf \"test/**/*.d.ts\" && tsc && tsd && type-coverage",
Expand Down
30 changes: 15 additions & 15 deletions test/async-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ test('async function transformer () {}', (t) => {
t.plan(5)

unified()
.use(() => {
return async function () {}
})
.use(() => {
return async function () {
return undefined
}
})
.use(() => {
return async function (tree, file) {
t.equal(tree, givenNode, 'passes correct tree to an async function')
t.equal(file, givenFile, 'passes correct file to an async function')
return modifiedNode
}
})
.use(() => async function () {})
.use(
() =>
async function () {
return undefined
}
)
.use(
() =>
async function (tree, file) {
t.equal(tree, givenNode, 'passes correct tree to an async function')
t.equal(file, givenFile, 'passes correct file to an async function')
return modifiedNode
}
)
.run(givenNode, givenFile, (error, tree, file) => {
t.error(error, 'should’t fail')
t.equal(tree, modifiedNode, 'passes given tree to `done`')
Expand Down
2 changes: 1 addition & 1 deletion test/freeze.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/

import test from 'tape'
import {SimpleCompiler, SimpleParser} from './util/simple.js'
import {unified} from '../index.js'
import {SimpleCompiler, SimpleParser} from './util/simple.js'

test('freeze()', (t) => {
const frozen = unified()
Expand Down
28 changes: 15 additions & 13 deletions test/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import test from 'tape'
import {VFile} from 'vfile'
import {SimpleCompiler, SimpleParser} from './util/simple.js'
import {unified} from '../index.js'
import {SimpleCompiler, SimpleParser} from './util/simple.js'

test('process(file, done)', (t) => {
const givenFile = new VFile('alpha')
Expand Down Expand Up @@ -45,12 +45,13 @@ test('process(file, done)', (t) => {
}
})
})
.use(() => {
return function (tree, file) {
t.equal(tree, givenNode, 'should pass `tree` to transformers')
t.equal(file, givenFile, 'should pass `file` to transformers')
}
})
.use(
() =>
function (tree, file) {
t.equal(tree, givenNode, 'should pass `tree` to transformers')
t.equal(file, givenFile, 'should pass `file` to transformers')
}
)
.use(function () {
Object.assign(this, {
/** @type {Compiler} */
Expand Down Expand Up @@ -99,12 +100,13 @@ test('process(file)', (t) => {
}
})
})
.use(() => {
return function (tree, file) {
t.equal(tree, givenNode, 'should pass `tree` to transformers')
t.equal(file, givenFile, 'should pass `file` to transformers')
}
})
.use(
() =>
function (tree, file) {
t.equal(tree, givenNode, 'should pass `tree` to transformers')
t.equal(file, givenFile, 'should pass `file` to transformers')
}
)
.use(function () {
Object.assign(this, {
/** @type {Compiler} */
Expand Down
Loading

0 comments on commit 3d50462

Please sign in to comment.