Skip to content

Commit

Permalink
Merge 61db4ad into d54f8ef
Browse files Browse the repository at this point in the history
  • Loading branch information
dijs committed Jul 11, 2018
2 parents d54f8ef + 61db4ad commit 6cbdd9e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"main": "./dist/wiki.js",
"dependencies": {
"infobox-parser": "3.0.1",
"infobox-parser": "3.0.2",
"isomorphic-fetch": "^2.2.1"
},
"devDependencies": {
Expand Down
26 changes: 16 additions & 10 deletions test/real.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ describe('Live tests', () => {
});
});
});
it('should use different names for "image" for foreign wikis', function(done) {
it('should use different names for "image" for foreign wikis', function() {
this.timeout(timeoutTime);
wiki({ apiUrl: 'https://es.wikipedia.org/w/api.php' })
return wiki({ apiUrl: 'https://es.wikipedia.org/w/api.php' })
.page('Cristiano Ronaldo')
.then(page => {
page.mainImage().then(mainImage => {
mainImage.should.equal('https://upload.wikimedia.org/wikipedia/commons/d/db/New_Zealand-Portugal_%2820%29.jpg');
done();
return page.mainImage().then(mainImage => {
mainImage.should.equal('https://upload.wikimedia.org/wikipedia/commons/8/8c/Cristiano_Ronaldo_2018.jpg');
});
});
});
Expand Down Expand Up @@ -105,14 +104,13 @@ describe('Live tests', () => {
});
});
});
it('should handle Issue #63', function(done) {
it('should handle Issue #63', function() {
this.timeout(timeoutTime);
wiki()
return wiki()
.findById(250197)
.then(page => {
page.mainImage().then(mainImage => {
mainImage.should.equal('https://upload.wikimedia.org/wikipedia/en/a/a3/Equipe_de_France_de_football_Logo.png');
done();
return page.mainImage().then(mainImage => {
mainImage.should.equal('https://upload.wikimedia.org/wikipedia/en/1/12/France_national_football_team_seal.svg');
});
});
});
Expand Down Expand Up @@ -192,4 +190,12 @@ describe('Live tests', () => {
.pagesInCategory('Category:Characters')
.then(pages => pages.should.containEql('Robin (Damian Wayne)'))
});
it('should handle issue #83', function() {
this.timeout(timeoutTime);
return wiki().page('athena').then(p => {
return p.mainImage().then(name => {
return name.should.equal('https://upload.wikimedia.org/wikipedia/commons/2/22/Mattei_Athena_Louvre_Ma530_n2.jpg');
});
});
});
});

0 comments on commit 6cbdd9e

Please sign in to comment.