Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a helpful message when .all-contributorsrc doesn't exist. #23

Merged
merged 4 commits into from
Oct 17, 2016

Conversation

fadc80
Copy link
Contributor

@fadc80 fadc80 commented Oct 14, 2016

Implement first item of issue #6

Could not find .all-contributorsrc file

@kentcdodds
Copy link
Collaborator

Could this be tested?

@kentcdodds
Copy link
Collaborator

LGTM

Copy link
Collaborator

@jfmengels jfmengels left a comment

Choose a reason for hiding this comment

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

Hey @fadc80! Thanks a lot for taking this on!

I have a few nitpicks, but otherwise it looks pretty good :)

});

test.cb('Writing contributors in an absent configuration file throws a helpful error', t => {
t.plan(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need for t.plan, the test will fail unless t.end is called anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. Thanks!

configFile.readConfig(absentFile);
}).message,
expected
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can simplify this like the following:

t.throws(() => {
  configFile.readConfig(absentFile);
}, expected);

because t.throws already takes an optional parameter allowing to verify the message of the error. See https://github.com/avajs/ava#throwsfunctionpromise-error-message

@jfmengels jfmengels merged commit 190813c into all-contributors:master Oct 17, 2016
@jfmengels
Copy link
Collaborator

Thanks a lot @fadc80! :)

@jfmengels
Copy link
Collaborator

I published this in v3.0.7.

Berkmann18 pushed a commit that referenced this pull request May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants