This repository was archived by the owner on Jul 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add test suite for `get-config` - Fix `get-config` to handle merging nested `gpg` property correctly
- Loading branch information
1 parent
1b8d183
commit cb0e2a9
Showing
3 changed files
with
51 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const assert = require('assertive'); | ||
|
||
const getConfig = require('../lib/get-config'); | ||
|
||
const ContextMock = require('./mocks/context'); | ||
|
||
describe('get-config', () => { | ||
it('should get the config', async () => { | ||
// Arrange | ||
const expected = { ignoreWebFlow: true }; | ||
const contextMock = new ContextMock(null, { gpg: expected }); | ||
|
||
// Act | ||
const actual = await getConfig(contextMock); | ||
|
||
// Assert | ||
assert.deepEqual(expected, actual); | ||
}); | ||
|
||
it('should return the default config if no GPG options are defined', async () => { | ||
// Arrange | ||
const expected = { ignoreWebFlow: false }; | ||
const contextMock = new ContextMock(null, {}); | ||
|
||
// Act | ||
const actual = await getConfig(contextMock); | ||
|
||
// Assert | ||
assert.deepEqual(expected, actual); | ||
}); | ||
|
||
it('should return the default config if other GPG options are defined', async () => { | ||
// Arrange | ||
const expected = { unused: 5, ignoreWebFlow: false }; | ||
const contextMock = new ContextMock(null, { gpg: { unused: 5 } }); | ||
|
||
// Act | ||
const actual = await getConfig(contextMock); | ||
|
||
// Assert | ||
assert.deepEqual(expected, actual); | ||
}); | ||
}); |
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