Skip to content

Commit fafff8a

Browse files
committed
Update dev-dependencies
1 parent 517828b commit fafff8a

File tree

3 files changed

+8
-40
lines changed

3 files changed

+8
-40
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"aria-attributes": "^2.0.0",
4646
"c8": "^8.0.0",
4747
"deepmerge": "^4.0.0",
48-
"hast-util-from-html": "^1.0.0",
49-
"hast-util-to-html": "^8.0.0",
48+
"hast-util-from-html": "^2.0.0",
49+
"hast-util-to-html": "^9.0.0",
5050
"hastscript": "^8.0.0",
5151
"html-element-attributes": "^3.0.0",
5252
"html-tag-names": "^2.0.0",

test/baseline.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ for (const [tagName, key, value] of extras) {
106106
// Final EOL.
107107
root.children.push({type: 'text', value: '\n'})
108108

109-
// @ts-expect-error: remove when `to-html` is released.
110109
const document = toHtml(root)
111110

112111
await fs.writeFile(new URL('input.html', import.meta.url), document)
@@ -115,8 +114,6 @@ const githubReferenceHtml = String(
115114
await fs.readFile(new URL('github.html', import.meta.url))
116115
)
117116

118-
/** @type {Root} */
119-
// @ts-expect-error: remove when `from-html` is released.
120117
const tree = fromHtml(githubReferenceHtml, {fragment: true})
121118

122119
/** @type {Set<string>} */

test/index.js

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ test('sanitize()', async function (t) {
4949
await t.test('should ignore unknown nodes', async function () {
5050
assert.equal(
5151
toHtml(
52-
// @ts-expect-error: remove when `hast-util-to-html` updates.
5352
sanitize(
5453
// @ts-expect-error: check how an unknown node is
5554
u('unknown', '<xml></xml>')
@@ -62,23 +61,14 @@ test('sanitize()', async function (t) {
6261

6362
test('`comment`', async function (t) {
6463
await t.test('should ignore `comment`s by default', async function () {
65-
assert.equal(
66-
toHtml(
67-
// @ts-expect-error: remove when `hast-util-to-html` updates.
68-
sanitize(u('comment', 'alpha'))
69-
),
70-
''
71-
)
64+
assert.equal(toHtml(sanitize(u('comment', 'alpha'))), '')
7265
})
7366

7467
await t.test(
7568
'should allow `comment`s with `allowComments: true`',
7669
async function () {
7770
assert.equal(
78-
toHtml(
79-
// @ts-expect-error: remove when `hast-util-to-html` updates.
80-
sanitize(u('comment', 'alpha'), {allowComments: true})
81-
),
71+
toHtml(sanitize(u('comment', 'alpha'), {allowComments: true})),
8272
'<!--alpha-->'
8373
)
8474
}
@@ -102,7 +92,6 @@ test('`comment`', async function (t) {
10292
async function () {
10393
assert.equal(
10494
toHtml(
105-
// @ts-expect-error: remove when `hast-util-to-html` updates.
10695
sanitize(u('comment', 'alpha--><script>alert(1)</script><!--bravo'), {
10796
allowComments: true
10897
})
@@ -115,19 +104,14 @@ test('`comment`', async function (t) {
115104

116105
test('`doctype`', async function (t) {
117106
await t.test('should ignore `doctype`s by default', async function () {
118-
assert.equal(
119-
// @ts-expect-error: remove when `hast-util-to-html` updates.
120-
toHtml(sanitize(u('doctype', {name: 'html'}, 'alpha'))),
121-
''
122-
)
107+
assert.equal(toHtml(sanitize(u('doctype', {name: 'html'}, 'alpha'))), '')
123108
})
124109

125110
await t.test(
126111
'should allow `doctype`s with `allowDoctypes: true`',
127112
async function () {
128113
assert.equal(
129114
toHtml(
130-
// @ts-expect-error: remove when `hast-util-to-html` updates.
131115
sanitize(u('doctype', {name: 'html'}, 'alpha'), {
132116
allowDoctypes: true
133117
})
@@ -168,11 +152,7 @@ test('`text`', async function (t) {
168152
})
169153

170154
await t.test('should allow `text`', async function () {
171-
assert.equal(
172-
// @ts-expect-error: remove when `hast-util-to-html` updates.
173-
toHtml(sanitize(u('text', 'alert(1)'))),
174-
'alert(1)'
175-
)
155+
assert.equal(toHtml(sanitize(u('text', 'alert(1)'))), 'alert(1)')
176156
})
177157

178158
await t.test('should ignore non-string `value`s', async function () {
@@ -184,21 +164,12 @@ test('`text`', async function (t) {
184164
})
185165

186166
await t.test('should ignore `text` in `script` elements', async function () {
187-
assert.equal(
188-
toHtml(
189-
// @ts-expect-error: remove when `hast-util-to-html` updates.
190-
sanitize(h('script', u('text', 'alert(1)')))
191-
),
192-
''
193-
)
167+
assert.equal(toHtml(sanitize(h('script', u('text', 'alert(1)')))), '')
194168
})
195169

196170
await t.test('should show `text` in `style` elements', async function () {
197171
assert.equal(
198-
toHtml(
199-
// @ts-expect-error: remove when `hast-util-to-html` updates.
200-
sanitize(h('style', u('text', 'alert(1)')))
201-
),
172+
toHtml(sanitize(h('style', u('text', 'alert(1)')))),
202173
'alert(1)'
203174
)
204175
})

0 commit comments

Comments
 (0)