From 4561b33ac34f9c09bfdbab257732e11e1db3cc48 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Wed, 2 Sep 2020 12:18:52 -0400 Subject: [PATCH] Add test to ensure empty documents with attributes still return empty objects --- test/xml/parser.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/xml/parser.spec.js b/test/xml/parser.spec.js index 6527b6fd53..36c5022094 100644 --- a/test/xml/parser.spec.js +++ b/test/xml/parser.spec.js @@ -36,6 +36,13 @@ return expect(data).to.eql({}); }); }); + it('returns an empty object from an empty document with attributes', function() { + var xml; + xml = ''; + return parse(xml, rules, function(data) { + return expect(data).to.eql({}); + }); + }); it('returns empty elements as empty string', function() { var xml; xml = '';