Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
tests: add check for sitemaps count in result
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Kosinov authored and Vladislav Kosinov committed May 19, 2015
1 parent 65407b1 commit f33e8ac
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/test.js
Expand Up @@ -189,7 +189,12 @@ describe('toXML()', function () {
sm.addUrl(path.join(hostName, i + ''));
}

sm.toXML().forEach(function eachShouldBeEqual(sm) {
var files = sm.toXML();

var filesExpectedCount = Object.keys(dataExpected['multiple-files']['splited-by-limit']).length;
files.length.should.be.eql(filesExpectedCount);

files.forEach(function eachShouldBeEqual(sm) {
sm.xml.should.equal(dataExpected['multiple-files']['splited-by-limit'][sm.fileName]);
});

Expand All @@ -215,7 +220,12 @@ describe('toXML()', function () {
sm1.addSitemap(sm3);
sm2.addSitemap(sm4);

sm1.toXML().forEach(function eachShouldBeEqual(sm) {
var files = sm1.toXML();

var filesExpectedCount = Object.keys(dataExpected['multiple-files']['horizontal-structure']).length;
files.length.should.be.eql(filesExpectedCount);

files.forEach(function eachShouldBeEqual(sm) {
sm.xml.should.equal(dataExpected['multiple-files']['horizontal-structure'][sm.fileName]);
});

Expand All @@ -242,6 +252,9 @@ describe('example from README', function () {

var files = sm.toXML();

var filesExpectedCount = Object.keys(dataExpected['multiple-files']['from-readme']).length;
files.length.should.be.eql(filesExpectedCount);

files.forEach(function eachShouldBeEqual(sm) {
sm.xml.should.equal(dataExpected['multiple-files']['from-readme'][sm.fileName]);
});
Expand Down

0 comments on commit f33e8ac

Please sign in to comment.