fix tests

This commit is contained in:
Maxim Lobanov 2021-03-09 11:36:53 +03:00
parent 87febe147a
commit 54adc8612c
2 changed files with 7 additions and 7 deletions

View file

@ -240,7 +240,7 @@ describe('normalizeVersion', () => {
it('normalizeVersion should throw an error for non semver', () => {
const version = '11g';
expect(DummyJavaBase.prototype.normalizeVersion.bind(null, version)).toThrowError(
`The string '${version}' is not valid SemVer notation for Java version. Please check README file for code snippets and more detailed information`
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
);
});
});

View file

@ -103,7 +103,7 @@ describe('setupJava', () => {
expect(spyTcFind).toHaveBeenCalled();
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${actualJavaVersion} from tool-cache`);
expect(spyCoreInfo).not.toHaveBeenCalledWith(
`Java ${inputs.version} is not found in tool-cache. Trying to unpack JDK file...`
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
);
});
@ -120,7 +120,7 @@ describe('setupJava', () => {
expect(spyTcFind).toHaveBeenCalled();
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${actualJavaVersion} from tool-cache`);
expect(spyCoreInfo).not.toHaveBeenCalledWith(
`Java ${inputs.version} is not found in tool-cache. Trying to unpack JDK file...`
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
);
});
@ -140,7 +140,7 @@ describe('setupJava', () => {
);
expect(spyCoreInfo).toHaveBeenCalledWith(`Extracting Java from '${jdkFile}'`);
expect(spyCoreInfo).toHaveBeenCalledWith(
`Java ${inputs.version} is not found in tool-cache. Trying to unpack JDK file...`
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
);
});
@ -155,7 +155,7 @@ describe('setupJava', () => {
mockJavaBase = new LocalDistribution(inputs, jdkFile);
expected.javaPath = path.join('Java_jdkfile_jdk', inputs.version, inputs.arch);
await expect(mockJavaBase.setupJava()).rejects.toThrowError(
"JDK file is not found in path 'not_existing_one'"
"JDK file was not found in path 'not_existing_one'"
);
expect(spyTcFindAllVersions).toHaveBeenCalled();
expect(spyCoreInfo).not.toHaveBeenCalledWith(
@ -163,7 +163,7 @@ describe('setupJava', () => {
);
expect(spyCoreInfo).not.toHaveBeenCalledWith(`Extracting Java from '${jdkFile}'`);
expect(spyCoreInfo).toHaveBeenCalledWith(
`Java ${inputs.version} is not found in tool-cache. Trying to unpack JDK file...`
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
);
});
@ -177,7 +177,7 @@ describe('setupJava', () => {
async (inputs, jdkFile) => {
mockJavaBase = new LocalDistribution(inputs, jdkFile);
await expect(mockJavaBase.setupJava()).rejects.toThrowError(
/JDK file is not found in path */
/JDK file was not found in path */
);
expect(spyTcFindAllVersions).toHaveBeenCalled();
}