mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-25 21:13:04 +07:00
16 lines
482 B
TypeScript
16 lines
482 B
TypeScript
import * as pecl from '../src/pecl';
|
|
|
|
let valid_extensions = ['xdebug', 'pcov'];
|
|
jest.mock('../src/pecl', () => ({
|
|
checkPECLExtension: jest.fn().mockImplementation(extension => {
|
|
return valid_extensions.indexOf(extension) !== -1;
|
|
})
|
|
}));
|
|
|
|
describe('pecl tests', () => {
|
|
it('checking checkPECLExtension', async () => {
|
|
expect(await pecl.checkPECLExtension('extensionDoesNotExist')).toBe(false);
|
|
expect(await pecl.checkPECLExtension('xdebug')).toBe(true);
|
|
});
|
|
});
|