Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-stocks

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-stocks - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

.jshintrc

4

dist/google-stocks.js

@@ -42,3 +42,3 @@ 'use strict';

return callback(error);
} else if (response.statusCode != 200) {
} else if (parseInt(response.statusCode, 10) !== 200) {
return callback('Webservice returned ' + response.statusCode);

@@ -65,5 +65,3 @@ }

;
exports['default'] = new GoogleStocks();
module.exports = exports['default'];
{
"name": "google-stocks",
"version": "0.1.4",
"version": "0.1.5",
"author": "anvk",

@@ -38,2 +38,3 @@ "main": "dist/google-stocks.js",

"gulp-mocha": "2.1.2",
"gulp-jshint": "1.12.0",
"mocha": "2.2.5"

@@ -40,0 +41,0 @@ },

@@ -23,3 +23,3 @@ 'use strict';

return callback(error);
} else if (response.statusCode != 200) {
} else if (parseInt(response.statusCode, 10) !== 200) {
return callback('Webservice returned ' + response.statusCode);

@@ -41,4 +41,4 @@ }

};
}
export default new GoogleStocks();

@@ -1,11 +0,10 @@

/* global it, describe, require */
'use strict';
var chai = require('chai'),
expect = chai.expect,
googleStocks = require('../dist/google-stocks.js');
import {expect} from 'chai';
import googleStocks from '../dist/google-stocks.js';
describe('google-stocks tests', function() {
describe('google-stocks tests', () => {
it('nothing was passed', function() {
googleStocks.get(undefined, function(error, data) {
it('nothing was passed', () => {
googleStocks.get(undefined, (error, data) => {
expect(error).to.equal('No Stocks were passed');

@@ -15,4 +14,4 @@ });

it('empty array', function() {
googleStocks.get([], function(error, data) {
it('empty array', () => {
googleStocks.get([], (error, data) => {
expect(error).to.equal('No Stocks were passed');

@@ -22,6 +21,6 @@ });

it('with a non existing code', function() {
it('with a non existing code', () => {
var codes = ['ZXY11_'];
googleStocks.get(codes, function(error, data) {
googleStocks.get(codes, (error, data) => {
expect(error).to.equal('Webservice returned 400');

@@ -32,6 +31,6 @@ expect(data).to.be.undefined;

it('proper stock code', function(done) {
it('proper stock code', done => {
var codes = ['AAPL'];
googleStocks.get(codes, function(error, data) {
googleStocks.get(codes, (error, data) => {
expect(error).to.be.null;

@@ -44,3 +43,3 @@ expect(data.length).to.equal(1);

it('with a different market code', function(done) {
it('with a different market code', done => {
var market = 'TSE',

@@ -50,3 +49,3 @@ code = 'WJA',

googleStocks.get(codes, function(error, data) {
googleStocks.get(codes, (error, data) => {
expect(error).to.be.null;

@@ -62,6 +61,6 @@ expect(data.length).to.equal(1);

it('with a an existing code and non existing code', function(done) {
it('with a an existing code and non existing code', done => {
var codes = ['ZXY11_', 'GOOG'];
googleStocks.get(codes, function(error, data) {
googleStocks.get(codes, (error, data) => {
expect(data.length).to.equal(1);

@@ -72,6 +71,6 @@ done();

it('with both existing codes and different markets', function(done) {
it('with both existing codes and different markets', done => {
var codes = ['TSE:WJA', 'GOOG'];
googleStocks.get(codes, function(error, data) {
googleStocks.get(codes, (error, data) => {
expect(data.length).to.equal(2);

@@ -78,0 +77,0 @@ done();

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