Socket
Socket
Sign inDemoInstall

testrail-jest-reporter

Package Overview
Dependencies
65
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.7 to 1.0.8

src/validator.js

7

package.json
{
"name": "testrail-jest-reporter",
"version": "1.0.7",
"version": "1.0.8",
"description": "Custom Jest reporter for Testrail synchronization",
"main": "index.js",
"engines": {
"node": ">=8.0.0"
"node": ">=10.0.0"
},

@@ -55,6 +55,5 @@ "scripts": {

"dependencies": {
"@prantlf/jsonlint": "^10.2.0",
"ajv": "^7.1.0",
"chalk": "^4.1.0",
"fs-extra": "^9.0.1",
"lodash": "^4.17.20",
"process": "^0.11.10",

@@ -61,0 +60,0 @@ "request": "^2.88.2",

'use strict';
const rp = require('request-promise'), chalk = require('chalk'), Utils = require('./utils'),
ReporterError = require('./error'), {compile} = require('@prantlf/jsonlint/lib/validator'),
{body: schema_body, data: schema_data} = require('./schemas');
const error = chalk.bold.red;
const rp = require('request-promise'), Utils = require('./utils'), ReporterError = require('./error');
const validator = require('./validator');
const utils = new Utils();

@@ -33,2 +31,3 @@ const post_methods = ['add_result_for_case', 'add_results_for_cases'];

let _path = uri;
const validate = validator(uri);
const data = utils.isPlainObject(args[args.length - 1]) ? args[args.length - 1] : null;

@@ -39,10 +38,3 @@ if (data) args.pop();

args.shift();
const validate_data = compile(JSON.stringify(schema_data[uri]));
try {
validate_data(JSON.stringify(data));
}
catch (err) {
throw new ReporterError(`\nInvalid request data for method ${uri}
Context: ${JSON.stringify(data)}\n${err.message}`);
}
validate.data(data);
caller = _base.defaults({

@@ -68,9 +60,3 @@ method: 'POST',

}
const validate_body = compile(JSON.stringify(schema_body[uri]));
try {
validate_body(JSON.stringify(resp.body));
}
catch (err) {
throw new ReporterError(`\nTestRail API response parsing error:\n${err.message}`);
}
validate.body(resp.body);
return resp.body;

@@ -77,0 +63,0 @@ })

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc