Fix xdebug and pcov on PHP7.4 and restructre code

This commit is contained in:
Shivam Mathur
2019-10-03 11:44:17 +05:30
parent eaf140ca8b
commit 2a30f9d208
18 changed files with 329 additions and 268 deletions
+15
View File
@@ -0,0 +1,15 @@
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);
});
});