fix: throw error in case of no package manager file found

This commit is contained in:
Kengo TODA 2021-08-19 19:54:35 +08:00
parent 33dfe174e3
commit 67b74a15de
4 changed files with 7 additions and 12 deletions

View file

@ -65,9 +65,8 @@ describe('dependency cache', () => {
});
describe('for maven', () => {
it('warns if no pom.xml found', async () => {
await restore('maven');
expect(spyWarning).toBeCalledWith(
it('throws error if no pom.xml found', async () => {
await expect(restore('maven')).rejects.toThrowError(
`No file in ${projectRoot(
workspace
)} matched to [**/pom.xml], make sure you have checked out the target repository`
@ -83,9 +82,8 @@ describe('dependency cache', () => {
});
});
describe('for gradle', () => {
it('warns if no build.gradle found', async () => {
await restore('gradle');
expect(spyWarning).toBeCalledWith(
it('throws error if no build.gradle found', async () => {
await expect(restore('gradle')).rejects.toThrowError(
`No file in ${projectRoot(
workspace
)} matched to [**/*.gradle*,**/gradle-wrapper.properties], make sure you have checked out the target repository`