Merge pull request #84 from decnorton/develop

Add problem matcher for PHPUnit
This commit is contained in:
Shivam Mathur
2019-12-19 02:18:02 +05:30
committed by GitHub
4 changed files with 69 additions and 0 deletions

View File

@ -1,4 +1,6 @@
import * as install from '../src/install';
import * as matchers from '../src/matchers';
import * as path from 'path';
/**
* Mock install.ts
@ -150,4 +152,34 @@ describe('Install', () => {
expect(script).toContain('set coverage driver');
expect(script).toContain('sh script.sh 7.3 ' + __dirname);
});
describe('Matchers', () => {
let originalLogMethod: any;
let outputData: any[] = [];
beforeAll(() => {
originalLogMethod = console.log;
console['log'] = jest.fn(inputs => outputData.push(inputs));
});
beforeEach(() => {
outputData = [];
});
afterAll(() => {
console['log'] = originalLogMethod;
});
it('Add matchers', async () => {
matchers.addMatchers();
expect(outputData).toEqual([
`##[add-matcher]${path.join(
__dirname,
'..',
'.github/matchers/phpunit.json'
)}`
]);
});
});
});