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.2.0 to 2.2.1

7

CHANGELOG.md

@@ -6,2 +6,9 @@ # Changelog

## [2.2.1]
### Fixed
- Fixed cast problem with string replace function when using CLI ENV variables with INT values.
## [2.2.0]

@@ -8,0 +15,0 @@

2

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

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -137,2 +137,3 @@ class ConfigService {

projectId = String(projectId);
projectId = projectId.replace('P', '');

@@ -170,2 +171,3 @@ projectId = projectId.trim();

milestoneId = String(milestoneId);
milestoneId = milestoneId.replace('M', '');

@@ -202,2 +204,3 @@ milestoneId = milestoneId.trim();

runId = String(runId);
runId = runId.replace('R', '');

@@ -204,0 +207,0 @@ runId = runId.trim();

import ConfigService from '../../../src/services/ConfigService';
test('undefined config returns default values', () => {
const config = new ConfigService(undefined);
expect(config.getRunId()).toBe('');
});
describe('TestRail Domain', () => {
test('null config returns default values', () => {
const config = new ConfigService(null);
expect(config.getRunId()).toBe('');
});
describe('.env file', () => {
test('empty config returns default values', () => {
const config = new ConfigService({});
expect(config.getRunId()).toBe('');
});
test('TestRailDomain from .env file', () => {
const config = new ConfigService({
'testrail': {
'domain': 'my-domain',
}
});
expect(config.getDomain()).toBe('my-domain');
});
test('runId is correctly read', () => {
const config = new ConfigService({
'testrail': {
'runId': '123',
}
});
expect(config.getRunId()).toBe('123');
});
test('leading R from Run ID is correctly removed', () => {
const config = new ConfigService({
'testrail': {
'runId': 'R123',
}
describe('ENV variable', () => {
test('TestRailDomain from ENV', () => {
const config = new ConfigService({
'TESTRAIL_DOMAIN': 'my-domain',
});
expect(config.getDomain()).toBe('my-domain');
});
});
expect(config.getRunId()).toBe('123');
});
test('runId with whitespace is correctly trimmed', () => {
const config = new ConfigService({
'testrail': {
'runId': ' 123 ',
}
describe('TestRail Username', () => {
describe('.env file', () => {
test('TestRailUsername from .env file', () => {
const config = new ConfigService({
'testrail': {
'username': 'user123',
}
});
expect(config.getUsername()).toBe('user123');
});
});
expect(config.getRunId()).toBe('123');
});
describe('ENV variable', () => {
test('domain is correctly read', () => {
const config = new ConfigService({
'testrail': {
'domain': 'my-domain',
}
test('TestRailUsername from ENV', () => {
const config = new ConfigService({
'TESTRAIL_USERNAME': 'user123',
});
expect(config.getUsername()).toBe('user123');
});
});
expect(config.getDomain()).toBe('my-domain');
});
test('username is correctly read', () => {
const config = new ConfigService({
'testrail': {
'username': 'user123',
}
describe('TestRail Password', () => {
describe('.env file', () => {
test('TestRailPassword from .env file', () => {
const config = new ConfigService({
'testrail': {
'password': 'P123',
}
});
expect(config.getPassword()).toBe('P123');
});
});
expect(config.getUsername()).toBe('user123');
});
test('password is correctly read', () => {
const config = new ConfigService({
'testrail': {
'password': 'P123',
}
describe('ENV variable', () => {
test('TestRailPassword from ENV', () => {
const config = new ConfigService({
'TESTRAIL_PASSWORD': 'P123',
});
expect(config.getPassword()).toBe('P123');
});
});
expect(config.getPassword()).toBe('P123');
});
test('projectId is correctly read', () => {
const config = new ConfigService({
'testrail': {
'projectId': '123',
}
describe('ProjectID', () => {
describe('.env file', () => {
test('ProjectID from .env file', () => {
const config = new ConfigService({
'testrail': {
'projectId': '123',
}
});
expect(config.getProjectId()).toBe('123');
});
test('ProjectID from .env file with leading P', () => {
const config = new ConfigService({
'testrail': {
'projectId': 'P123',
}
});
expect(config.getProjectId()).toBe('123');
});
test('ProjectID from .env file with whitespaces', () => {
const config = new ConfigService({
'testrail': {
'projectId': ' 123 ',
}
});
expect(config.getProjectId()).toBe('123');
});
test('ProjectID from .env as INT', () => {
const config = new ConfigService({
'testrail': {
'projectId': 123,
}
});
expect(config.getProjectId()).toBe('123');
});
});
expect(config.getProjectId()).toBe('123');
});
test('leading P from Project ID is correctly removed', () => {
const config = new ConfigService({
'testrail': {
'projectId': 'P123',
}
describe('ENV variable', () => {
test('ProjectID from ENV variable as INT', () => {
const config = new ConfigService({
'TESTRAIL_PROJECT_ID': 45,
});
expect(config.getProjectId()).toBe('45');
});
});
expect(config.getProjectId()).toBe('123');
});
test('projectId with whitespace is correctly trimmed', () => {
const config = new ConfigService({
'testrail': {
'projectId': ' 123 ',
}
describe('MilestoneID', () => {
describe('.env file', () => {
test('MilestoneID from .env', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': 'P123',
}
});
expect(config.getMilestoneId()).toBe('P123');
});
test('MilestoneID from .env with leading M', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': 'M123',
}
});
expect(config.getMilestoneId()).toBe('123');
});
test('MilestoneID from .env with whitespaces', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': ' 123 ',
}
});
expect(config.getMilestoneId()).toBe('123');
});
test('MilestoneID from .env as INT', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': 123,
}
});
expect(config.getMilestoneId()).toBe('123');
});
});
expect(config.getProjectId()).toBe('123');
});
test('milestoneId is correctly read', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': 'P123',
}
describe('ENV variable', () => {
test('MilestoneID from ENV variable as INT', () => {
const config = new ConfigService({
'TESTRAIL_MILESTONE_ID': 45,
});
expect(config.getMilestoneId()).toBe('45');
});
});
expect(config.getMilestoneId()).toBe('P123');
});
test('leading M from Milestone ID is correctly removed', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': 'M123',
}
describe('RunID', () => {
describe('.env file', () => {
test('RunID from .env file', () => {
const config = new ConfigService({
'testrail': {
'runId': '123',
}
});
expect(config.getRunId()).toBe('123');
});
test('RunID from .env file with leading R', () => {
const config = new ConfigService({
'testrail': {
'runId': 'R123',
}
});
expect(config.getRunId()).toBe('123');
});
test('RunID from .env file with whitespaces', () => {
const config = new ConfigService({
'testrail': {
'runId': ' 123 ',
}
});
expect(config.getRunId()).toBe('123');
});
test('RunID from .env as INT', () => {
const config = new ConfigService({
'testrail': {
'runId': 123,
}
});
expect(config.getRunId()).toBe('123');
});
});
expect(config.getMilestoneId()).toBe('123');
});
test('milestoneId with whitespace is correctly trimmed', () => {
const config = new ConfigService({
'testrail': {
'milestoneId': ' 123 ',
}
describe('ENV variable', () => {
test('RunID from ENV variable as INT', () => {
const config = new ConfigService({
'TESTRAIL_RUN_ID': 455,
});
expect(config.getRunId()).toBe('455');
});
});
expect(config.getMilestoneId()).toBe('123');
});
test('runName is correctly read', () => {
const config = new ConfigService({
'testrail': {
'runName': 'P123',
}
describe('RunName', () => {
describe('.env file', () => {
test('RunName from .env file', () => {
const config = new ConfigService({
'testrail': {
'runName': 'P123',
}
});
expect(config.getRunName()).toBe('P123');
});
});
expect(config.getRunName()).toBe('P123');
describe('ENV variable', () => {
test('RunName from ENV', () => {
const config = new ConfigService({
'TESTRAIL_RUN_NAME': 'P123',
});
expect(config.getRunName()).toBe('P123');
});
});
});
test('closeRun is correctly read', () => {
const config = new ConfigService({
'testrail': {
'closeRun': true,
}
describe('CloseRun', () => {
describe('.env file', () => {
test('CloseRun from .env file', () => {
const config = new ConfigService({
'testrail': {
'closeRun': true,
}
});
expect(config.shouldCloseRun()).toBe(true);
});
});
expect(config.shouldCloseRun()).toBe(true);
describe('ENV variable', () => {
test('CloseRun from ENV', () => {
const config = new ConfigService({
'TESTRAIL_RUN_CLOSE': true,
});
expect(config.shouldCloseRun()).toBe(true);
});
});
test('closeRun default is FALSE', () => {
const config = new ConfigService({});
expect(config.shouldCloseRun()).toBe(false);
});
});
test('closeRun default is FALSE', () => {
const config = new ConfigService({});
expect(config.shouldCloseRun()).toBe(false);
describe('Invalid Configurations', () => {
test('undefined config returns default values', () => {
const config = new ConfigService(undefined);
expect(config.getRunId()).toBe('');
});
test('null config returns default values', () => {
const config = new ConfigService(null);
expect(config.getRunId()).toBe('');
});
test('empty config returns default values', () => {
const config = new ConfigService({});
expect(config.getRunId()).toBe('');
});
});
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