-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show a helpful message when .all-contributorsrc doesn't exist. (#23)
* Show a helpful message when .all-contributorsrc doesn't exist. * Adding unit tests. * Better test descriptions. * Just code improvements.
- Loading branch information
Showing
3 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import test from 'ava'; | ||
import configFile from './config-file.js'; | ||
|
||
const absentFile = './abc'; | ||
const expected = 'Configuration file not found: ' + absentFile; | ||
|
||
test('Reading an absent configuration file throws a helpful error', t => { | ||
t.throws(() => { | ||
configFile.readConfig(absentFile); | ||
}, expected); | ||
}); | ||
|
||
test.cb('Writing contributors in an absent configuration file throws a helpful error', t => { | ||
configFile.writeContributors(absentFile, [], error => { | ||
t.is(error.message, expected); | ||
t.end(); | ||
}); | ||
}); |