From ad70a18c06f5a3c93f02f855489d1c0f900f43d3 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 25 Nov 2021 01:44:57 +0700 Subject: [PATCH] Add failing test for #51 --- test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test.js b/test.js index ebc0fdc..472ff83 100644 --- a/test.js +++ b/test.js @@ -63,3 +63,8 @@ test('line endings - works at EOF', t => { test('handles weird escaping', t => { t.is(stripJsonComments(String.raw`{"x":"x \"sed -e \\\"s/^.\\\\{46\\\\}T//\\\" -e \\\"s/#033/\\\\x1b/g\\\"\""}`), String.raw`{"x":"x \"sed -e \\\"s/^.\\\\{46\\\\}T//\\\" -e \\\"s/#033/\\\\x1b/g\\\"\""}`); }); + +test.failing('handles malformed block comments', t => { + t.is(stripJsonComments('[] */'), '[] */'); + t.is(stripJsonComments('[] /*'), '[] /*'); // Fails +});