imdb-trivia
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -14,4 +14,4 @@ 'use strict'; | ||
return cb({ | ||
status: 'failed', | ||
status_code: res.statusCode | ||
status_code: res.statusCode, | ||
details: res.body | ||
}); | ||
@@ -34,2 +34,3 @@ } | ||
let movieTitle = jq('meta[property="og:title"]').attr('content'); | ||
let results = []; | ||
@@ -40,10 +41,9 @@ | ||
results[index] = { | ||
text: item.text().trim().replace(/\\/g, '') | ||
}; | ||
results[index] = item.text().trim().replace(/\\/g, ''); | ||
}); | ||
return cb(null, { | ||
total: results.length, | ||
results: results | ||
title: movieTitle, | ||
trivia_count: results.length, | ||
trivia: results | ||
}); | ||
@@ -50,0 +50,0 @@ }); |
{ | ||
"name": "imdb-trivia", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A NodeJS library for fetching IMDb movie trivia", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,7 +7,8 @@ 'use strict'; | ||
it('should successfully return trivia results for the movie with IMDb id tt1431045', function (done) { | ||
it('should successfully return trivia for the movie with IMDb ID tt1431045', function (done) { | ||
imdbTrivia('tt1431045', function (err, res) { | ||
try { | ||
should(res).have.property('total'); | ||
should(res).have.property('results'); | ||
should(res).have.property('title'); | ||
should(res).have.property('trivia_count'); | ||
should(res).have.property('trivia'); | ||
done(); | ||
@@ -14,0 +15,0 @@ } catch (e) { |
Sorry, the diff of this file is not supported yet
5708
57
37