Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix tests to properly handle windows \r\n line endings

  • Loading branch information...
commit af6850f259a66706a9bcb3ea5343f2e23d4c50b3 1 parent 3e176cd
@christav christav authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 test/xml2js.test.coffee
View
4 test/xml2js.test.coffee
@@ -4,6 +4,7 @@ fs = require 'fs'
util = require 'util'
assert = require 'assert'
path = require 'path'
+os = require 'os'
fileName = path.join __dirname, '/fixtures/sample.xml'
@@ -16,7 +17,8 @@ skeleton = (options, checks) ->
checks r
test.finish()
if not xmlString
- fs.readFile fileName, (err, data) ->
+ fs.readFile fileName, 'utf8', (err, data) ->
+ data = data.split(os.EOL).join('\n')
x2js.parseString data
else
x2js.parseString xmlString
Please sign in to comment.
Something went wrong with that request. Please try again.