jest-allure2-reporter
Version:
Idiomatic Jest reporter for Allure Framework
33 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.onTestFileStart = onTestFileStart;
exports.onTestCaseResult = onTestCaseResult;
exports.onTestFileResult = onTestFileResult;
const ThreadService_1 = require("./ThreadService");
const threadService = new ThreadService_1.ThreadService();
function onTestFileStart(test, testFileMetadata) {
const threadId = threadService.allocateThread(test.path);
testFileMetadata
.assign({
sourceLocation: { fileName: test.path },
start: Date.now(),
})
.push('labels', [{ name: 'thread', value: String(1 + threadId).padStart(2, '0') }]);
}
function onTestCaseResult(test, testCase, testCaseMetadata) {
testCaseMetadata.defaults({
sourceLocation: testCase.location
? {
fileName: test.path,
lineNumber: testCase.location.line,
columnNumber: testCase.location.column + 1,
}
: undefined,
stop: Date.now(),
});
}
function onTestFileResult(test, testFileMetadata) {
testFileMetadata.set('stop', Date.now());
threadService.freeThread(test.path);
}
//# sourceMappingURL=fallbacks.js.map