-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move throwOnNotFound option to ConfigFile
- Loading branch information
1 parent
f11b84a
commit 924352a
Showing
4 changed files
with
25 additions
and
39 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
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ const $$ = testSetup(); | |
|
||
describe('AuthInfoConfigTest', () => { | ||
const username = '[email protected]'; | ||
let options: AuthInfoConfig.Options; | ||
let options: ConfigFile.Options; | ||
beforeEach(() => { | ||
$$.SANDBOXES.CONFIG.restore(); | ||
stubMethod($$.SANDBOX, ConfigFile.prototype, 'write').callsFake(async () => { | ||
|
@@ -28,7 +28,7 @@ describe('AuthInfoConfigTest', () => { | |
$$.SANDBOX.restore(); | ||
}); | ||
|
||
it ('init should throw', async () => { | ||
it('init should throw', async () => { | ||
options.throwOnNotFound = true; | ||
try { | ||
await shouldThrow(AuthInfoConfig.create(options)); | ||
|
@@ -37,15 +37,12 @@ describe('AuthInfoConfigTest', () => { | |
} | ||
}); | ||
|
||
it ('init should throw on undefined', async () => { | ||
try { | ||
await shouldThrow(AuthInfoConfig.create(options)); | ||
} catch (e) { | ||
expect(e).to.have.property('code', 'ENOENT'); | ||
} | ||
it('init should throw on undefined', async () => { | ||
const authInfoConfig = await AuthInfoConfig.create(options); | ||
expect(authInfoConfig.getPath()).to.include('[email protected]'); | ||
}); | ||
|
||
it ('init shouldn\'t throw', async () => { | ||
it("init shouldn't throw", async () => { | ||
options.throwOnNotFound = false; | ||
const authInfoConfig = await AuthInfoConfig.create(options); | ||
expect(authInfoConfig.getPath()).to.include('[email protected]'); | ||
|