mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-13 00:04:09 +07:00
Bump version to 2.12.0
Update Node.js dependencies
This commit is contained in:
@ -49,15 +49,17 @@ describe('Utils tests', () => {
|
||||
});
|
||||
|
||||
it('checking parseVersion', async () => {
|
||||
jest.spyOn(utils, 'fetch').mockImplementation(async (url, token?): Promise<
|
||||
Record<string, string>
|
||||
> => {
|
||||
if (!token || token === 'valid_token') {
|
||||
return {data: `{ "latest": "8.0", "5.x": "5.6", "url": "${url}" }`};
|
||||
} else {
|
||||
return {error: 'Invalid token'};
|
||||
}
|
||||
});
|
||||
jest
|
||||
.spyOn(utils, 'fetch')
|
||||
.mockImplementation(
|
||||
async (url, token?): Promise<Record<string, string>> => {
|
||||
if (!token || token === 'valid_token') {
|
||||
return {data: `{ "latest": "8.0", "5.x": "5.6", "url": "${url}" }`};
|
||||
} else {
|
||||
return {error: 'Invalid token'};
|
||||
}
|
||||
}
|
||||
);
|
||||
expect(await utils.parseVersion('latest')).toBe('8.0');
|
||||
expect(await utils.parseVersion('7')).toBe('7.0');
|
||||
expect(await utils.parseVersion('7.4')).toBe('7.4');
|
||||
|
Reference in New Issue
Block a user