Skip to content

Commit 59afb1a

Browse files
committed
prettified the messages
1 parent b696361 commit 59afb1a

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

bin/helpers/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
let config = require("./config");
2+
let colors = require('colors');
23

34
const syncCLI = {
45
FAILED_SPEC_DETAILS_COL_HEADER: ['Spec', 'Status', 'Browser', 'BrowserStack Session ID'],
@@ -61,7 +62,7 @@ const userMessages = {
6162
DOWNLOAD_BUILD_ARTIFACTS_SUCCESS: "Your build artifact(s) have been successfully downloaded in '<user-path>/build_artifacts/<build-id>' directory",
6263
LATEST_SYNTAX_TO_ACTUAL_VERSION_MESSAGE: "Your build will run using Cypress <actualVersion> as you had specified <latestSyntaxVersion>.<frameworkUpgradeMessage> Read more about supported versions here: http://browserstack.com/docs/automate/cypress/supported-versions",
6364
PROCESS_KILL_MESSAGE: "Stopping the CLI and the execution of the build on BrowserStack",
64-
BUILD_FAILED_ERROR: "The above stacktrace has been thrown by Cypress when we tried to run your build. If your test suite requires npm dependencies then please specify them on browserstack.json. Read more at https://www.browserstack.com/docs/automate/cypress/npm-packages. Also, we recommend you to try running the build locally using ‘cypress run’ and if it works fine then please reach out to support at https://www.browserstack.com/contact#technical-support"
65+
BUILD_FAILED_ERROR: "The above stacktrace has been thrown by Cypress when we tried to run your build. If your test suite requires npm dependencies then please specify them on browserstack.json. Read more at " + "https://www.browserstack.com/docs/automate/cypress/npm-packages".blue + ". Also, we recommend you to try running the build locally using ‘cypress run’ and if it works fine then please reach out to support at " + "https://www.browserstack.com/contact#technical-support".blue
6566
};
6667

6768
const validationMessages = {

bin/helpers/downloadBuildStacktrace.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
'use strict'
22
const fs = require('fs'),
3-
request = require('request'),
4-
{ inspect } = require('util'),
5-
Constants = require("./constants"),
6-
chalk = require('chalk');
3+
request = require('request');
74

85
const downloadBuildStacktrace = async (url) => {
96
let writer = fs.createWriteStream('a.txt');
107
return new Promise(async (resolve, reject) => {
118
request.get(url).on('data', (data) => {
12-
console.log(chalk.bold(data.toString()));
9+
console.log(data.toString());
1310
}).on('error', (err) => {
1411
reject();
1512
}).on('end', () => {

bin/helpers/sync/syncSpecsLogs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const request = require("request"),
99
tableStream = require('table').createStream,
1010
chalk = require('chalk');
1111

12-
const { inspect } = require('util');
1312
let whileLoop = true, whileTries = config.retries, options, timeout = 3000, n = 2, tableConfig, stream, endTime, startTime = Date.now(), buildStarted = false;
1413
let specSummary = {
1514
"buildError": null,
@@ -172,7 +171,7 @@ let showSpecsStatus = (data) => {
172171
} else if (specDetails["stacktrace_url"]) {
173172
specSummary.exitCode = config.buildFailedExitCode;
174173
specSummary.buildError = specDetails["stacktrace_url"]
175-
console.log(chalk.bold.red(specDetails["message"]));
174+
winstonLogger.error(chalk.red(specDetails["message"]));
176175
} else {
177176
if(!buildStarted) {
178177
buildStarted = true

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"update-notifier": "^5.1.0",
2929
"uuid": "^8.3.2",
3030
"winston": "2.4.4",
31-
"yargs": "^14.2.3"
31+
"yargs": "^14.2.3",
32+
"colors": "1.0.3"
3233
},
3334
"repository": {
3435
"type": "git",

0 commit comments

Comments
 (0)