-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(packager): introduce unit tests for packagers, fix bugs found on …
…testing
- Loading branch information
1 parent
23854b7
commit b33be2f
Showing
8 changed files
with
600 additions
and
61 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
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,21 @@ | ||
/** | ||
* Unit tests for packagers/index | ||
*/ | ||
|
||
import { get } from '../../src/packagers'; | ||
import { NPM } from '../../src/packagers/npm'; | ||
import * as Utils from '../../src/utils'; | ||
|
||
const getCurrentPackager = jest.spyOn(Utils, 'getCurrentPackager'); | ||
|
||
describe('packagers factory', () => { | ||
it('should throw on unknown packagers', () => { | ||
getCurrentPackager.mockReset().mockReturnValue('unknown' as never); | ||
expect(() => get('.')).toThrowError(/Could not find packager 'unknown'/); | ||
}); | ||
|
||
it('should return npm packager', () => { | ||
const npm = get('.', 'npm'); | ||
expect(npm).toBeInstanceOf(NPM); | ||
}); | ||
}); |
Oops, something went wrong.