Skip to content

Commit

Permalink
test: fix tests for escapeFilterComponent()
Browse files Browse the repository at this point in the history
  • Loading branch information
federicocarboni committed Oct 27, 2020
1 parent 89102a4 commit 699ded6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/string_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ describe('escape', function () {
describe('escapeFilterComponent()', function () {
it('should escape special characters', function () {
const unescaped = "I'm a string;, with many[special]: characters";
const escaped = "I\\'m a string\\;\\, with many\\[special\\]\\: characters";
const escaped = "I\\'m\\ a\\ string\\;\\,\\ with\\ many\\[special\\]\\:\\ characters";
expect(escapeFilterComponent(unescaped)).equals(escaped);
});
it('should escape special characters (non-string)', function () {
// @ts-expect-error
expect(escapeFilterComponent({})).equals('\\[object Object\\]');
expect(escapeFilterComponent({})).equals('\\[object\\ Object\\]');
});
});
});

0 comments on commit 699ded6

Please sign in to comment.