Skip to content

Commit

Permalink
Add test for #99
Browse files Browse the repository at this point in the history
  • Loading branch information
oozcitak committed Jul 30, 2021
1 parent f427a5a commit 7146d34
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/issues/issue-099.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import $$ from "../TestHelpers";

describe("Replicate issue", () => {
// https://github.com/oozcitak/xmlbuilder2/issues/99
test(`#99 - Most XML entities not being decoded by reader (with unknown entity)`, () => {
expect(() => $$.create('<ssid>Me &amp; Myself&apos;s WiFi &copy;&#x1D306;</ssid>')).toThrow()
})

test(`#99 - Most XML entities not being decoded by reader`, () => {
const xmlResponse = $$.create('<ssid>Me &amp; Myself&apos;s WiFi &#x1D306;</ssid>');
const networkResponse = xmlResponse.end({format: 'object'});
expect(networkResponse).toEqual({
ssid: `Me &amp; Myself's WiFi 𝌆`
})
})
})

0 comments on commit 7146d34

Please sign in to comment.