Skip to content

Commit

Permalink
Merge pull request #505 from HubSpot/fail-jasmine-ontest-fail
Browse files Browse the repository at this point in the history
Fail jasmine ontest fail
  • Loading branch information
drewjenkins authored May 19, 2021
2 parents 0b1b183 + 23d5fd2 commit 58cc1f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions acceptance-tests/jasmine.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"spec_files": ["*[sS]pec.js"],
"helpers": ["helpers/**/*.js"],
"stopSpecOnExpectationFailure": false,
"stopOnSpecFailure": true,
"random": false
}
3 changes: 2 additions & 1 deletion acceptance-tests/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ setArgsOverrides(
const testRunner = new Jasmine();
testRunner.loadConfigFile(path.join(__dirname, 'jasmine.json'));
testRunner.addReporter(reporter);
testRunner.onComplete(function() {
testRunner.onComplete(function(passed) {
rimraf.sync(CONFIG_FILE_PATH);
process.exit(passed ? 0 : 1);
});
const cliPath = path.join(process.cwd(), '../packages/cli/bin/hs');
const cli = cmd.create(cliPath, '.');
Expand Down
9 changes: 9 additions & 0 deletions packages/cli/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ notifier.notify({
message: pkg.name === '@hubspot/cms-cli' ? CLI_UPGRADE_MESSAGE : null,
});

const getTerminalWidth = () => {
const width = yargs.terminalWidth();

if (width >= 100) return width * 0.9;

return width;
};

const argv = yargs
.usage('Tools for working with HubSpot')
.middleware([setLogLevel])
Expand Down Expand Up @@ -90,6 +98,7 @@ const argv = yargs
.recommendCommands()
.demandCommand(1, '')
.completion()
.wrap(getTerminalWidth())
.strict().argv;

if (argv.help) {
Expand Down

0 comments on commit 58cc1f1

Please sign in to comment.