diff --git a/example/getinfo.js b/example/getinfo.js index f3969c9..c3cf6b6 100644 --- a/example/getinfo.js +++ b/example/getinfo.js @@ -3,7 +3,7 @@ const GetFlix = require('../index'); const getflix = new GetFlix('d9d6007d1bcf12043db5a085ae3e5bbb'); const getInfo = async () => { try { - const info = await getflix.getInfo('80244780'); + const info = await getflix.get('80244780'); console.log(info); } catch (error) { diff --git a/lib/index.js b/lib/index.js index 467d178..71b4bfd 100644 --- a/lib/index.js +++ b/lib/index.js @@ -16,7 +16,7 @@ class FlixInfo { } - getInfo(netflixId) { + get(netflixId) { // Imdb id page const flixableURL = config.filexibleURL + netflixId; diff --git a/package.json b/package.json index 7dbc954..9a5d8a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flixinfo", - "version": "1.1.1", + "version": "1.1.3", "description": "Get movie detail with netflix id", "main": "index.js", "directories": { diff --git a/test/flixinfo.test.js b/test/flixinfo.test.js index f211dc0..6f71ece 100644 --- a/test/flixinfo.test.js +++ b/test/flixinfo.test.js @@ -21,7 +21,7 @@ describe('Flix Info', () => { const flixinfoWrongApiKey = new GetFlix('sfs345k34jlkdflgkjdfglk435j345klj'); - flixinfoWrongApiKey.getInfo(70143836) + flixinfoWrongApiKey.get(70143836) .catch(result => { result.should.have.property('error').equal(1); result.should.have.property('errorMsg').equal('tmdb find id wrong api key error'); @@ -32,14 +32,14 @@ describe('Flix Info', () => { }); }); - describe('#getInfo()', () => { + describe('#get()', () => { const flixinfo = new GetFlix('d9d6007d1bcf12043db5a085ae3e5bbb'); context('Return result infos', () => { // Movie test it('- movies return right result', (done) => { - flixinfo.getInfo(70131314) + flixinfo.get(70131314) .then(result => { result.should.have.property('result').equal(1); result.should.have.property('error').equal(0); @@ -58,7 +58,7 @@ describe('Flix Info', () => { }); // // Tv test it('- tv series return right result', (done) => { - flixinfo.getInfo(80232926) + flixinfo.get(80232926) .then(result => { result.should.have.property('result').equal(1); result.should.have.property('error').equal(0); @@ -76,7 +76,7 @@ describe('Flix Info', () => { }); it('- return empty result', (done) => { - flixinfo.getInfo(70143836) + flixinfo.get(70143836) .then(result => { result.should.have.property('error').equal(0); done(); @@ -84,7 +84,7 @@ describe('Flix Info', () => { }); it('- flixable.com and tmdb.com connection error', (done) => { nock.disableNetConnect(); //Prevents making request external connection - flixinfo.getInfo(70143836) + flixinfo.get(70143836) .catch(result => { result.should.have.property('error').equal(1); result.should.have.property('errorMsg');