testrail-jest-reporter
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"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
118498
7
18
2257
+ Addedajv@^7.1.0
+ Addedajv@7.2.4(transitive)
+ Addedjson-schema-traverse@1.0.0(transitive)
+ Addedrequire-from-string@2.0.2(transitive)
- Removed@prantlf/jsonlint@^10.2.0
- Removedlodash@^4.17.20
- Removed@prantlf/jsonlint@10.2.0(transitive)
- Removedajv@6.10.2(transitive)
- Removedcommander@4.0.1(transitive)
- Removedfast-deep-equal@2.0.1(transitive)