Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Remove process exit from config commands - closes #580 #586

Merged
merged 4 commits into from
Jul 31, 2018

Conversation

yatki
Copy link
Contributor

@yatki yatki commented Jul 30, 2018

Review checklist

@yatki yatki self-assigned this Jul 30, 2018
@yatki yatki requested review from shuse2 and willclarktech July 30, 2018 15:03
@@ -20,20 +20,18 @@ import defaultConfig from '../../default_config.json';
import { CONFIG_VARIABLES } from './constants';
import { ValidationError } from './error';
import { readJSONSync, writeJSONSync } from './fs';
import logger from './logger';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was actually the only place the logger was used.
Since we use the logger from the oclif now, i think we are good to delete this function

expect(process.exit).to.be.calledWithExactly(1);
return expect(logger.error).to.be.calledWithExactly(
`ERROR: Could not write to \`${defaultPath}\`. Your configuration will not be persisted.`,
return expect(() => getConfig(defaultPath)).to.throw(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other test suite, we do something like getConfig.bind(null, defaultPath)
so as other places below.

Copy link
Contributor

@willclarktech willclarktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to add besides @shuse2 's comments.

@shuse2 shuse2 merged commit 397b9b0 into 2.0.0 Jul 31, 2018
@shuse2 shuse2 deleted the 580-remove-process-exit branch July 31, 2018 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants