Add jest-junit fixture project

This commit is contained in:
Michal Dorner 2020-10-18 21:08:40 +02:00
parent 83a6323aa9
commit f861278768
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
7 changed files with 4835 additions and 1 deletions

View file

@ -0,0 +1,23 @@
const lib = require('../lib/main')
describe('Test 1', () => {
test('Passing test', () => {
expect(true).toBeTruthy()
});
describe('Test 1.1', () => {
test('Failing test', () => {
expect(false).toBeTruthy()
});
test('Exception in target unit', () => {
lib.throwError();
});
});
});
describe('Test 2', () => {
test('Exception in test', () => {
throw new Error('Some error');
});
});

View file

@ -0,0 +1,7 @@
test('Timeout test', async () => {
await new Promise(resolve => setTimeout(resolve, 1000));
}, 1);
test.skip('Skipped test', () => {
// do nothing
});

5
reports/jest/lib/main.js Normal file
View file

@ -0,0 +1,5 @@
function throwError() {
throw new Error('Some error')
}
exports.throwError = throwError

4717
reports/jest/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

21
reports/jest/package.json Normal file
View file

@ -0,0 +1,21 @@
{
"name": "jest-fixture",
"version": "0.0.0",
"private": true,
"description": "Generates test fixtures for test-check action",
"scripts": {
"test": "jest --ci --reporters=default --reporters=jest-junit"
},
"author": "Michal Dorner <dorner.michal@gmail.com>",
"license": "MIT",
"devDependencies": {
"jest": "^26.5.3",
"jest-junit": "^12.0.0"
},
"jest-junit": {
"suiteName": "jest tests",
"outputDirectory": "../../__tests__/fixtures",
"outputName": "jest-junit.xml",
"uniqueOutputName": "false"
}
}