Toggle navigation
P3X GitList Snapshot
GitHub
Repo
Changelog
To do
Releases
Themes
Change log
Loading change log ...
To do ...
Loading todo ...
browsing:
b758f3acf8ed80b7161c0e195b9195ede3362e11
Branches
0.1
0.2
html-sanitizer
html-sanitizer-and-mocha-specs
master
sanitize-oversight
Tags
v0.11.2
v0.11.0
v0.9.2
v0.9.0
v0.8.2
v0.6.2
v0.6.1
v0.6.0
v0.5.1
v0.5.0
v0.4.0
v0.3.2
v0.3.1
v0.3.0
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
Files
Commits
Log
Graph
Stats
xml2json.git
test
test.js
RSS
Git
Fetch origin
Download
ZIP
TAR
Clone
Raw
View
History
Clone
SSH
HTTPS
Blames found: 17
Mode: javascript
Binary: false
Hang on, we reloading big blames...
d80fb054
var fs = require('fs'); var path = require('path'); var parser = require('../lib'); var assert = require('assert');
6983c816
var fixturesPath = './fixtures';
d80fb054
fs.readdir(fixturesPath, function(err, files) {
6983c816
for (var i in files) {
d80fb054
var file = files[i]; var ext = path.extname(file);
6983c816
if (ext == '.xml') {
d80fb054
var basename = path.basename(file, '.xml'); var data = fs.readFileSync(fixturesPath + '/' + file); var result = parser.toJson(data);
6facb9a2
var data2 = fs.readFileSync(fixturesPath + '/' + file); result = parser.toJson(data2);
6983c816
d80fb054
var jsonFile = basename + '.json' var expected = fs.readFileSync(fixturesPath + '/' + jsonFile) + '';
6983c816
if (result) {
d80fb054
result = result.trim(); }
6983c816
if (expected) {
d80fb054
expected = expected.trim(); } assert.deepEqual(result, expected, jsonFile + ' and ' + file + ' are different');
6a202d68
console.log('All tests passed!');
d80fb054
} } });
6983c816