From 56da82e19eb0cec84c4ac7ce69ad4e89959d72e9 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 13 Aug 2021 08:19:49 +0200 Subject: [PATCH] Refactor tests to hide expected warning --- test/test.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test.jsx b/test/test.jsx index 0f07dabb..a3baa986 100644 --- a/test/test.jsx +++ b/test/test.jsx @@ -992,6 +992,10 @@ test('can render the whole spectrum of markdown within a single run', () => { }) test('sanitizes certain dangerous urls for links by default', () => { + const error = console.error + + console.error = () => {} + const input = [ '# [Much fun](javascript:alert("foo"))', "Can be had with [XSS links](vbscript:foobar('test'))", @@ -1011,6 +1015,8 @@ test('sanitizes certain dangerous urls for links by default', () => { actual, '

Much fun

\n

Can be had with XSS links

\n
\n

And other nonsense... files for instance

\n
\n

Entities can be tricky, too

\n

Regular links must be allowed

\n

Some ref

\n

Should allow mailto and tel links tho

\n

Also, protocol-agnostic should be allowed

\n

local paths should be allowed

\n

allow weird query strings and hashes

' ) + + console.error = error }) test('allows specifying a custom URI-transformer', () => {