From c5e40d90670a77b7373aafbe8a21f2f095b9e604 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 19 Jun 2020 14:47:34 +0530 Subject: [PATCH] Fix Xdebug coverage --- __tests__/coverage.test.ts | 6 ++++++ dist/index.js | 2 +- src/coverage.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/__tests__/coverage.test.ts b/__tests__/coverage.test.ts index cc158312..455f6ed1 100644 --- a/__tests__/coverage.test.ts +++ b/__tests__/coverage.test.ts @@ -47,6 +47,12 @@ describe('Config tests', () => { expect(linux).toContain('echo "xdebug.mode=coverage"'); }); + it('checking addCoverage with Xdebug on linux', async () => { + const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux'); + expect(linux).toContain('add_extension xdebug'); + expect(linux).toContain('echo "xdebug.mode=coverage"'); + }); + it('checking addCoverage with Xdebug on darwin', async () => { const darwin: string = await coverage.addCoverage( 'xdebug', diff --git a/dist/index.js b/dist/index.js index aa7ea308..1ffe2e6f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2163,7 +2163,7 @@ async function addCoverageXdebug(extension, version, os_version, pipe) { return '\n' + xdebug + '\n' + ini + '\n' + log; case /^xdebug$/.test(extension): default: - return '\n' + xdebug + '\n' + log; + return xdebug + '\n' + log; } } exports.addCoverageXdebug = addCoverageXdebug; diff --git a/src/coverage.ts b/src/coverage.ts index 19dccfcb..182c280e 100644 --- a/src/coverage.ts +++ b/src/coverage.ts @@ -34,7 +34,7 @@ export async function addCoverageXdebug( return '\n' + xdebug + '\n' + ini + '\n' + log; case /^xdebug$/.test(extension): default: - return '\n' + xdebug + '\n' + log; + return xdebug + '\n' + log; } }