Skip to content

Commit

Permalink
refactor: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asambstack committed Aug 23, 2024
1 parent 7cb8b2e commit e9fcb29
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bin/helpers/buildArtifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const unzipFile = async (filePath, fileName) => {
});
} catch (unzipperError) {
logger.debug(`Unzipper package error: ${unzipperError}`);
reject(Constants.debugMessages.BUILD_ARTIFACTS_UNZIP_FAILURE);
reject(Constants.userMessages.BUILD_ARTIFACTS_UNZIP_FAILURE);
}
}
});
Expand Down
8 changes: 2 additions & 6 deletions bin/helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ const userMessages = {
CYPRESS_PORT_WARNING:
"The requested port number <x> is ignored. The default BrowserStack port will be used for this execution",
CYPRESS_INTERACTIVE_SESSION_CONFLICT_VALUES:
"Conflicting values (True & False) were found for the interactive_debugging capability. Please resolve this issue to proceed further."
"Conflicting values (True & False) were found for the interactive_debugging capability. Please resolve this issue to proceed further.",
BUILD_ARTIFACTS_UNZIP_FAILURE: "Failed to unzip build artifacts.",
};

const validationMessages = {
Expand Down Expand Up @@ -271,10 +272,6 @@ const cliMessages = {
},
};

const debugMessages = {
BUILD_ARTIFACTS_UNZIP_FAILURE: "Failed to unzip build artifacts",
};

const messageTypes = {
SUCCESS: "success",
ERROR: "error",
Expand Down Expand Up @@ -459,7 +456,6 @@ module.exports = Object.freeze({
syncCLI,
userMessages,
cliMessages,
debugMessages,
validationMessages,
messageTypes,
allowedFileTypes,
Expand Down
12 changes: 2 additions & 10 deletions test/unit/bin/helpers/buildArtifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ const chai = require("chai"),
sinon = require('sinon'),
rewire = require('rewire');

const fs = require('fs'),
path = require('path'),
request = require('request'),
unzipper = require("unzipper"),
decompress = require('decompress');
Constants = require("../../../../bin/helpers/constants"),
logger = require("../../../../bin/helpers/logger").winstonLogger,
testObjects = require("../../support/fixtures/testObjects"),
formatRequest = require("../../../../bin/helpers/utils").formatRequest;
const logger = require("../../../../bin/helpers/logger").winstonLogger;

chai.use(chaiAsPromised);
logger.transports["console.info"].silent = true;
Expand Down Expand Up @@ -41,7 +33,7 @@ describe('unzipFile', () => {
pathJoinStub = sinon.stub().returns(`${filePath}/${fileName}`);

Constants = {
debugMessages: {
userMessages: {
BUILD_ARTIFACTS_UNZIP_FAILURE: 'Unzip failed',
},
};
Expand Down

0 comments on commit e9fcb29

Please sign in to comment.