Fix matchers and add tests

This commit is contained in:
Shivam Mathur
2019-12-19 10:44:43 +05:30
parent 8039546df3
commit 1798f4d615
7 changed files with 103 additions and 40 deletions
-32
View File
@@ -1,6 +1,4 @@
import * as install from '../src/install';
import * as matchers from '../src/matchers';
import * as path from 'path';
/**
* Mock install.ts
@@ -152,34 +150,4 @@ 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'
)}`
]);
});
});
});