mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-08 22:04:10 +07:00
Refactor utils.fetch to a module and mock it with nock
Add redirect support in utils.fetch
This commit is contained in:
@ -33,6 +33,15 @@ jest.mock('../src/install', () => ({
|
||||
})
|
||||
}));
|
||||
|
||||
/**
|
||||
* Mock fetch.ts
|
||||
*/
|
||||
jest.mock('../src/fetch', () => ({
|
||||
fetch: jest.fn().mockImplementation(() => {
|
||||
return {data: '{ "latest": "8.1", "5.x": "5.6" }'};
|
||||
})
|
||||
}));
|
||||
|
||||
describe('Install', () => {
|
||||
it.each`
|
||||
version | os | extension_csv | ini_file | ini_values_csv | coverage_driver | tools | output
|
||||
|
Reference in New Issue
Block a user