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

@brainly/onesky-utils

Package Overview
Dependencies
Maintainers
19
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brainly/onesky-utils - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

.github/workflows/ci.yml

2

lib/globals.js

@@ -5,5 +5,5 @@

var _globals = {
apiAddress: 'https://platform.api.onesky.io/'
apiAddress: 'https://platform.api.onesky.io'
};
module.exports = _globals;
{
"name": "@brainly/onesky-utils",
"version": "1.4.1",
"version": "1.4.2",
"description": "Node.js utils for working with OneSky translation service.",

@@ -27,3 +27,3 @@ "main": "index.js",

"eslint": "^5.12.0",
"mocha": "^5.2.0",
"mocha": "^7.2.0",
"mockery": "^2.1.0",

@@ -30,0 +30,0 @@ "sinon": "^7.2.2",

@@ -54,3 +54,3 @@ /* eslint-env mocha */

response: {
body: '{ message: \'Unable to upload document\', code: 400 }'
body: '{ "message": "Unable to upload document", "code": 400 }'
}

@@ -57,0 +57,0 @@ });

/* eslint-env mocha */
'use strict';
"use strict";
function rootRequire (name) {
return require(__dirname + '/../' + name);
function rootRequire(name) {
return require(__dirname + "/../" + name);
}
var mockery = require('mockery');
var chai = require('chai');
var mockery = require("mockery");
var chai = require("chai");
var expect = chai.expect;
var sinon = require('sinon');
var sinonChai = require('sinon-chai');
var sinon = require("sinon");
var sinonChai = require("sinon-chai");
var requestPromise;

@@ -19,5 +19,5 @@ var oneskyUtils;

describe('POST screenshots', function () {
describe("POST screenshots", function () {
afterEach(function () {
mockery.deregisterSubstitute('request-promise');
mockery.deregisterSubstitute("request-promise");
mockery.disable();

@@ -28,10 +28,10 @@ });

defaultOptions = {
projectId: 'projectId',
secret: 'secret',
apiKey: 'apiKey',
name: 'name',
image: 'image',
projectId: "projectId",
secret: "secret",
apiKey: "apiKey",
name: "name",
image: "image",
tags: [
{
key: 'key',
key: "key",
x: 1,

@@ -41,11 +41,11 @@ y: 2,

height: 4,
file: 'file'
}
]
file: "file",
},
],
};
mockery.registerMock('request-promise', function (request) {
mockery.registerMock("request-promise", function (request) {
// Assert well formed request
expect(request.method).to.equal('POST');
expect(request.method).to.equal("POST");
expect(request.form.secret).to.be.undefined;
expect(request.form.api_key).to.equal('apiKey');
expect(request.form.api_key).to.equal("apiKey");
expect(request.form.dev_hash).to.not.be.undefined;

@@ -57,5 +57,5 @@ expect(request.form.timestamp).to.not.be.undefined;

expect(screenshot.name).to.equal('name');
expect(screenshot.image).to.equal('image');
expect(screenshot.tags[0].key).to.equal('key');
expect(screenshot.name).to.equal("name");
expect(screenshot.image).to.equal("image");
expect(screenshot.tags[0].key).to.equal("key");
expect(screenshot.tags[0].x).to.equal(1);

@@ -65,3 +65,3 @@ expect(screenshot.tags[0].y).to.equal(2);

expect(screenshot.tags[0].height).to.equal(4);
expect(screenshot.tags[0].file).to.equal('file');
expect(screenshot.tags[0].file).to.equal("file");

@@ -73,14 +73,14 @@ return requestPromise;

warnOnUnregistered: false,
useCleanCache: true
useCleanCache: true,
});
oneskyUtils = rootRequire('index.js');
oneskyUtils = rootRequire("index.js");
});
it('Return error request fails with 400', function () {
it("Return error request fails with 400", function () {
requestPromise = new Promise(function (resolve, reject) {
reject({
response: {
body: "{ message: 'Unable to upload document', code: 400 }"
}
body: '{ "message": "Unable to upload document", "code": 400 }',
},
});

@@ -96,7 +96,7 @@ });

expect(error.code).to.equal(400);
expect(error.message).to.equal('Unable to upload document');
expect(error.message).to.equal("Unable to upload document");
});
});
it('Return success on valid content', function (done) {
it("Return success on valid content", function (done) {
var successCallback = sinon.spy();

@@ -108,4 +108,4 @@ var errorCallback = sinon.spy();

response: {
body: '{"meta":{"status":201},"data":{}}'
}
body: '{"meta":{"status":201},"data":{}}',
},
});

@@ -112,0 +112,0 @@ });

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