New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cypress-testrail

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-testrail - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

14

CHANGELOG.md

@@ -5,2 +5,16 @@ # Changelog

## [2.2.0]
### Changed
- RunIDs can now also be provided with a leading "R" and spaces. The integration will automatically remove it.
- ProjectIDs can now also be provided with a leading "P" and spaces. The integration will automatically remove it.
- MilestoneIDs can now also be provided with a leading "M" and spaces. The integration will automatically remove it.
### Fixed
- Fixed problem with missing axio package when doing an installation from scratch
## [2.1.1]

@@ -7,0 +21,0 @@

6

package.json
{
"name": "cypress-testrail",
"version": "2.1.1",
"version": "2.2.0",
"description": "Easy and decoupled Cypress TestRail reporter",

@@ -19,6 +19,8 @@ "main": "index.js",

},
"dependencies": {
"axios": "^0.27.2"
},
"devDependencies": {
"@babel/eslint-parser": "^7.18.2",
"@babel/preset-env": "^7.18.2",
"axios": "^0.27.2",
"babel-jest": "^28.1.1",

@@ -25,0 +27,0 @@ "eslint": "^8.18.0",

@@ -120,17 +120,22 @@ class ConfigService {

let projectId = '';
// CYPRESS_TESTRAIL_PROJECT_ID
if (this.config.TESTRAIL_PROJECT_ID !== undefined && this.config.TESTRAIL_PROJECT_ID !== '') {
return this.config.TESTRAIL_PROJECT_ID;
}
projectId = this.config.TESTRAIL_PROJECT_ID;
} else {
if (this.config.testrail === undefined || this.config.testrail === null) {
return '';
}
if (this.config.testrail === undefined || this.config.testrail === null) {
return '';
projectId = this.config.testrail.projectId;
if (projectId === undefined || projectId === null) {
return '';
}
}
const projectId = this.config.testrail.projectId;
projectId = projectId.replace('P', '');
projectId = projectId.trim();
if (projectId === undefined || projectId === null) {
return '';
}
return projectId;

@@ -148,17 +153,22 @@ }

let milestoneId = '';
// CYPRESS_TESTRAIL_MILESTONE_ID
if (this.config.TESTRAIL_MILESTONE_ID !== undefined && this.config.TESTRAIL_MILESTONE_ID !== '') {
return this.config.TESTRAIL_MILESTONE_ID;
}
milestoneId = this.config.TESTRAIL_MILESTONE_ID;
} else {
if (this.config.testrail === undefined || this.config.testrail === null) {
return '';
}
if (this.config.testrail === undefined || this.config.testrail === null) {
return '';
milestoneId = this.config.testrail.milestoneId;
if (milestoneId === undefined || milestoneId === null) {
return '';
}
}
const milestoneId = this.config.testrail.milestoneId;
milestoneId = milestoneId.replace('M', '');
milestoneId = milestoneId.trim();
if (milestoneId === undefined || milestoneId === null) {
return '';
}
return milestoneId;

@@ -176,17 +186,21 @@ }

let runId = '';
// CYPRESS_TESTRAIL_RUN_ID
if (this.config.TESTRAIL_RUN_ID !== undefined && this.config.TESTRAIL_RUN_ID !== '') {
return this.config.TESTRAIL_RUN_ID;
}
runId = this.config.TESTRAIL_RUN_ID;
} else {
if (this.config.testrail === undefined || this.config.testrail === null) {
return '';
}
runId = this.config.testrail.runId;
if (this.config.testrail === undefined || this.config.testrail === null) {
return '';
if (runId === undefined || runId === null) {
return '';
}
}
const runId = this.config.testrail.runId;
runId = runId.replace('R', '');
runId = runId.trim();
if (runId === undefined || runId === null) {
return '';
}
return runId;

@@ -193,0 +207,0 @@ }

@@ -1,2 +0,2 @@

import ConfigService from "../../../src/services/ConfigService";
import ConfigService from '../../../src/services/ConfigService';

@@ -22,8 +22,27 @@

'testrail': {
'runId': '123',
}
});
expect(config.getRunId()).toBe('123');
});
test('leading R from Run ID is correctly removed', () => {
const config = new ConfigService({
'testrail': {
'runId': 'R123',
}
});
expect(config.getRunId()).toBe('R123');
expect(config.getRunId()).toBe('123');
});
test('runId with whitespace is correctly trimmed', () => {
const config = new ConfigService({
'testrail': {
'runId': ' 123 ',
}
});
expect(config.getRunId()).toBe('123');
});
test('domain is correctly read', () => {

@@ -59,8 +78,26 @@ const config = new ConfigService({

'testrail': {
'projectId': '123',
}
});
expect(config.getProjectId()).toBe('123');
});
test('leading P from Project ID is correctly removed', () => {
const config = new ConfigService({
'testrail': {
'projectId': 'P123',
}
});
expect(config.getProjectId()).toBe('P123');
expect(config.getProjectId()).toBe('123');
});
test('projectId with whitespace is correctly trimmed', () => {
const config = new ConfigService({
'testrail': {
'projectId': ' 123 ',
}
});
expect(config.getProjectId()).toBe('123');
});
test('milestoneId is correctly read', () => {

@@ -75,2 +112,20 @@ const config = new ConfigService({

test('leading M from Milestone ID is correctly removed', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': 'M123',
}
});
expect(config.getMilestoneId()).toBe('123');
});
test('milestoneId with whitespace is correctly trimmed', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': ' 123 ',
}
});
expect(config.getMilestoneId()).toBe('123');
});
test('runName is correctly read', () => {

@@ -77,0 +132,0 @@ const config = new ConfigService({

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