mirror of
https://github.com/actions/setup-java.git
synced 2026-06-24 13:17:46 +00:00
update test case
This commit is contained in:
parent
6dc10d31ce
commit
614a228ff3
@ -96,7 +96,7 @@ describe('dependency cache', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('for maven', () => {
|
describe('for maven', () => {
|
||||||
it('throws error if no pom.xml found', async () => {
|
it('throws error if no pom.xml or maven-wrapper.properties found', async () => {
|
||||||
await expect(restore('maven', '')).rejects.toThrow(
|
await expect(restore('maven', '')).rejects.toThrow(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
@ -107,7 +107,13 @@ describe('dependency cache', () => {
|
|||||||
createFile(join(workspace, 'pom.xml'));
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
|
||||||
await restore('maven', '');
|
await restore('maven', '');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
|
[
|
||||||
|
join(os.homedir(), '.m2', 'repository'),
|
||||||
|
join(os.homedir(), '.m2', 'wrapper', 'dists')
|
||||||
|
],
|
||||||
|
expect.any(String)
|
||||||
|
);
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties'
|
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties'
|
||||||
);
|
);
|
||||||
@ -122,7 +128,13 @@ describe('dependency cache', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await restore('maven', '');
|
await restore('maven', '');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
|
[
|
||||||
|
join(os.homedir(), '.m2', 'repository'),
|
||||||
|
join(os.homedir(), '.m2', 'wrapper', 'dists')
|
||||||
|
],
|
||||||
|
expect.any(String)
|
||||||
|
);
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties'
|
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties'
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user