From 7c82195c54cf3a3da723c45177ba433ec2927195 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 5 Aug 2021 16:11:53 +0200 Subject: [PATCH] Update dev-dependencies --- package.json | 12 +++++------- test/index.js | 33 +++++++++++++++------------------ 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 17c32bb..bd57c22 100644 --- a/package.json +++ b/package.json @@ -38,16 +38,14 @@ }, "devDependencies": { "c8": "^7.0.0", - "dtslint": "^4.0.0", - "is-hidden": "^1.0.0", - "not": "^0.1.0", + "is-hidden": "^2.0.0", "prettier": "^2.0.0", - "remark": "^13.0.0", - "remark-cli": "^9.0.0", + "remark": "^14.0.0", + "remark-cli": "^10.0.0", "remark-preset-wooorm": "^8.0.0", "tape": "^5.0.0", - "to-vfile": "^6.0.0", - "unified": "^9.0.0", + "to-vfile": "^7.0.0", + "unified": "^10.0.0", "xo": "^0.37.0" }, "scripts": { diff --git a/test/index.js b/test/index.js index 6a3260b..daa00c4 100644 --- a/test/index.js +++ b/test/index.js @@ -1,32 +1,29 @@ import fs from 'fs' import path from 'path' import test from 'tape' -import vfile from 'to-vfile' -import unified from 'unified' -import remark from 'remark' -import not from 'not' -import hidden from 'is-hidden' -import frontmatter from '../index.js' +import {readSync} from 'to-vfile' +import {unified} from 'unified' +import {remark} from 'remark' +import {isHidden} from 'is-hidden' +import remarkFrontmatter from '../index.js' var join = path.join var read = fs.readFileSync var write = fs.writeFileSync var dir = fs.readdirSync -test('frontmatter()', function (t) { - t.equal(typeof frontmatter, 'function', 'should be a function') - +test('remarkFrontmatter', function (t) { t.doesNotThrow(function () { - remark().use(frontmatter).freeze() + remark().use(remarkFrontmatter).freeze() }, 'should not throw if not passed options') t.doesNotThrow(function () { - unified().use(frontmatter).freeze() + unified().use(remarkFrontmatter).freeze() }, 'should not throw if without parser or compiler') t.throws( function () { - unified().use(frontmatter, [1]).freeze() + unified().use(remarkFrontmatter, [1]).freeze() }, /^Error: Expected matter to be an object, not `1`/, 'should throw if not given a preset or a matter' @@ -34,7 +31,7 @@ test('frontmatter()', function (t) { t.throws( function () { - unified().use(frontmatter, ['jsonml']).freeze() + unified().use(remarkFrontmatter, ['jsonml']).freeze() }, /^Error: Missing matter definition for `jsonml`/, 'should throw if given an unknown preset' @@ -43,7 +40,7 @@ test('frontmatter()', function (t) { t.throws( function () { unified() - .use(frontmatter, [{marker: '*'}]) + .use(remarkFrontmatter, [{marker: '*'}]) .freeze() }, /^Error: Missing `type` in matter `{"marker":"\*"}`/, @@ -53,7 +50,7 @@ test('frontmatter()', function (t) { t.throws( function () { unified() - .use(frontmatter, [{type: 'jsonml'}]) + .use(remarkFrontmatter, [{type: 'jsonml'}]) .freeze() }, /^Error: Missing `marker` or `fence` in matter `{"type":"jsonml"}`/, @@ -65,7 +62,7 @@ test('frontmatter()', function (t) { test('fixtures', function (t) { var base = join('test', 'fixtures') - var entries = dir(base).filter(not(hidden)) + var entries = dir(base).filter((d) => !isHidden(d)) t.plan(entries.length) @@ -73,7 +70,7 @@ test('fixtures', function (t) { function each(fixture) { t.test(fixture, function (st) { - var input = vfile.readSync(join(base, fixture, 'input.md')) + var input = readSync(join(base, fixture, 'input.md')) var treePath = join(base, fixture, 'tree.json') var outputPath = join(base, fixture, 'output.md') var output @@ -86,7 +83,7 @@ test('fixtures', function (t) { config = JSON.parse(read(join(base, fixture, 'config.json'))) } catch (_) {} - proc = remark().use(frontmatter, config) + proc = remark().use(remarkFrontmatter, config) actual = JSON.parse(JSON.stringify(proc.parse(input))) try {