Skip to content

Commit

Permalink
Add failing test for #51
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 24, 2021
1 parent 78e8234 commit ad70a18
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test.js
Expand Up @@ -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
});

0 comments on commit ad70a18

Please sign in to comment.