airportyh/testem — pull request #367 by dcfsc (2014-05-13 23:14:38+00:00)
Title: escape XML entities in test names e.g. <tags> to not break XUnitReporter...

Our test:
```javascript
describe("

should display the basic title info", function() { ....
```
ran using Testem via Lineman.

```xml
<testcase name="PhantomJS 1.9 title directive <title> should display the basic title info should define a payload."/>
```

However, this is invalid XML - the angle brackets <> are bad. Our Jenkins build failed due to invalid XML parsing.

```
Caused by: org.dom4j.DocumentException: Error on line 6 of document file:///home/jenkins/slave1/workspace/metasearch-app-ui/target/test-reports/metasearch-app-ui-xunit.xml :
The value of attribute "name" associated with an element type "null" must not contain the '<' character.
Nested exception: The value of attribute "name" associated with an element type "null" must not contain
the '<' character.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:112)
at hudson.tasks.junit.TestResult.parse(TestResult.java:227)
... 15 more
Caused by: org.xml.sax.SAXParseException: The value of attribute "name" associated with an element type "null" must not contain the '<' character.
```
The fix uses the [npm module xml-escape](https://www.npmjs.org/package/xml-escape "xml-escape npm page") which is similar to every other snippet out there but packaged in npm and modifies one test. I also check for all the possible XML entities.