Skip to content

Commit 5e5cdd2

Browse files
Add warn in constants
1 parent 8102831 commit 5e5cdd2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

bin/helpers/capabilityHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ const validate = (bsConfig, args) => {
287287
logger.warn(Constants.validationMessages.NODE_VERSION_PARSING_ERROR);
288288

289289
if(!Utils.isUndefined(cypressConfigFile.port)) {
290-
logger.warn(`The requested port number ${cypressConfigFile.port} is ignored. The default BrowserStack port will be used for this execution`);
290+
logger.warn(Constants.userMessages.CYPRESS_PORT_WARNING.replace("<x>", cypressConfigFile.port));
291291
}
292292
resolve(cypressConfigFile);
293293
});

bin/helpers/constants.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ const userMessages = {
113113
SPEC_LIMIT_SUCCESS_MESSAGE:
114114
"Spec timeout specified as <x> minutes. If any of your specs exceed the specified time limit, it would be forcibly killed by BrowserStack",
115115
NO_CONNECTION_WHILE_UPDATING_UPLOAD_PROGRESS_BAR:
116-
"Unable to determine zip upload progress due to undefined/null connection request"
116+
"Unable to determine zip upload progress due to undefined/null connection request",
117+
CYPRESS_PORT_WARNING:
118+
"The requested port number <x> is ignored. The default BrowserStack port will be used for this execution"
117119
};
118120

119121
const validationMessages = {

test/unit/bin/helpers/capabilityHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ describe("capabilityHelper.js", () => {
10631063
await capabilityHelper
10641064
.validate(bsConfig, { parallels: 2 })
10651065

1066-
sinon.assert.calledWith(loggerWarningSpy, `The requested port number 23455 is ignored. The default BrowserStack port will be used for this execution`);
1066+
sinon.assert.calledWith(loggerWarningSpy, Constants.userMessages.CYPRESS_PORT_WARNING.replace('<x>', 23455));
10671067
fs.existsSync.restore();
10681068
fs.readFileSync.restore();
10691069
});

0 commit comments

Comments
 (0)