better-cypress-testrail-reporter
Advanced tools
Comparing version 1.3.6 to 1.3.7
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TestRailValidation = void 0; | ||
var glob = require('glob'); | ||
var TestRailLogger = require('./testrail.logger'); | ||
var glob = require("glob"); | ||
var TestRailLogger = require("./testrail.logger"); | ||
var TestRailValidation = /** @class */ (function () { | ||
@@ -12,10 +12,10 @@ function TestRailValidation(options) { | ||
if (!reporterOptions) { | ||
throw new Error('Missing reporterOptions in cypress.json'); | ||
throw new Error("Missing reporterOptions in cypress.json"); | ||
} | ||
this.validate(reporterOptions, 'host'); | ||
this.validate(reporterOptions, 'username'); | ||
this.validate(reporterOptions, 'password'); | ||
this.validate(reporterOptions, 'projectId'); | ||
this.validate(reporterOptions, "host"); | ||
this.validate(reporterOptions, "username"); | ||
this.validate(reporterOptions, "password"); | ||
this.validate(reporterOptions, "projectId"); | ||
if (this.options.suiteId) { | ||
this.validate(reporterOptions, 'suiteId'); | ||
this.validate(reporterOptions, "suiteId"); | ||
} | ||
@@ -42,3 +42,3 @@ return reporterOptions; | ||
value = cliArgs[index]; | ||
if (value.includes('testRailSuiteId') === true) { | ||
if (value.includes("testRailSuiteId") === true) { | ||
result = value; | ||
@@ -56,3 +56,3 @@ break; | ||
value = resultArrayArgs[index]; | ||
if (value.includes('testRailSuiteId') === true) { | ||
if (value.includes("testRailSuiteId") === true) { | ||
result = value; | ||
@@ -78,2 +78,3 @@ break; | ||
// Read and store cli arguments into array | ||
// Read and store cli arguments into array | ||
var cliArgs = process.argv.slice(2); | ||
@@ -84,4 +85,5 @@ /** | ||
*/ | ||
var index, value, result, directory; | ||
var workingDirectory = []; | ||
var pat = /\/([^\/]*?\*.*|[^\/]*$)/; | ||
var index, value, result, directory, pattern; | ||
var searchPattern = []; | ||
var specFiles = []; | ||
@@ -101,13 +103,13 @@ var specFilesArray = []; | ||
value = specArg[index]; | ||
result = value.replace(/(?:[^\w])+/g, "/"); | ||
directory = result.replace(/\b(js|ts|feature)\b/, ''); | ||
workingDirectory.push(directory); | ||
directory = value.replace(pat, "/"); | ||
pattern = value.match(pat)[1]; | ||
searchPattern.push([pattern, directory]); | ||
} | ||
for (index = 0; index < workingDirectory.length; ++index) { | ||
value = workingDirectory[index]; | ||
for (index = 0; index < searchPattern.length; ++index) { | ||
value = searchPattern[index][1]; | ||
var options = { | ||
cwd: value, | ||
nodir: true | ||
nodir: true, | ||
}; | ||
result = glob.sync("**/*", options); | ||
result = glob.sync(searchPattern[index][0], options); | ||
specFiles.push(result); | ||
@@ -114,0 +116,0 @@ } |
{ | ||
"name": "better-cypress-testrail-reporter", | ||
"version": "1.3.6", | ||
"version": "1.3.7", | ||
"description": "A Testrail reporter for cypress including TestRail API basic library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
36858
622