New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

imdbtr

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imdbtr - npm Package Compare versions

Comparing version 0.3.3 to 0.4.0

test/imdbtr.spec.js

16

package.json
{
"name": "imdbtr",
"version": "0.3.3",
"version": "0.4.0",
"description": "IMDB on terminal",

@@ -25,6 +25,7 @@ "license": "MIT",

"dependencies": {
"chalk": "^1.1.1",
"figures": "^1.4.0",
"got": "^6.1.1",
"minimist": "^1.2.0"
"chalk": "^1.1.3",
"figures": "^1.7.0",
"got": "^6.3.0",
"minimist": "^1.2.0",
"ora": "^0.2.3"
},

@@ -37,4 +38,5 @@ "keywords": [

"devDependencies": {
"ava": "^0.11.0",
"xo": "^0.12.1"
"ava": "^0.15.2",
"sinon": "^1.17.4",
"xo": "^0.16.0"
},

@@ -41,0 +43,0 @@ "bin": {

'use strict';
const got = require('got');
const helpers = require('./helpers');
const got = require('got');
const provider = 'http://www.omdbapi.com/?';

@@ -22,4 +23,4 @@ const headers = {

})
.catch(error => {
return error.body;
.catch(err => {
return err.body;
});

@@ -26,0 +27,0 @@

'use strict';
const normalizeName = name => {
const nameList = name.split(' ', 2);
const nameList = name.split(' ');

@@ -6,0 +6,0 @@ let normalizedList = nameList.map(currName => {

'use strict';
const api = require('./api.js');
const chalk = require('chalk');
const figures = require('figures');
const ora = require('ora');
const api = require('./api.js');

@@ -14,3 +15,5 @@ const imdbtr = name => {

const spinner = ora(`Searching for ${chalk.yellow(name)}`).start();
return movie.then(result => {
spinner.stop();
if (!result) {

@@ -33,2 +36,6 @@ return console.log(chalk.yellow.bold('Movie not found on IMDB :('));

console.log(movieRes);
}).catch(err => {
spinner.stop();
console.error(chalk.red.bold('Something went wrong :('));
console.error(err);
});

@@ -35,0 +42,0 @@ };

'use strict';
const test = require('ava');
const api = require('../src/helpers.js');
const helpers = require('../src/helpers.js');
test(`should return the name of movie when it's valid title`, async t => {
const result = await api('The Godfather');
test(`should return a compound name with plus char`, t => {
t.is(helpers.normalizeName('The Walking Dead'), 'The+Walking+Dead');
});
t.is(result.Title, 'The Godfather');
t.is(result.Year, '1972');
test(`should return a name with accent encoded`, t => {
t.is(helpers.normalizeName('Garoto Cósmico'), 'Garoto+C%C3%B3smico');
});
test(`should return a name with one word`, t => {
t.is(helpers.normalizeName('Deadpool'), 'Deadpool');
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc