mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-08 05:44:07 +07:00
Merge pull request #84 from decnorton/develop
Add problem matcher for PHPUnit
This commit is contained in:
@ -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'
|
||||
)}`
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user