@testomatio/reporter 2.9.3-beta.4-allure-links → 2.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +0,0 @@
1
- export default KotlinAdapter;
2
- declare class KotlinAdapter extends Adapter {
3
- getFilePath(t: any): string;
4
- }
5
- import Adapter from './adapter.js';
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const path_1 = __importDefault(require("path"));
7
- const adapter_js_1 = __importDefault(require("./adapter.js"));
8
- class KotlinAdapter extends adapter_js_1.default {
9
- getFilePath(t) {
10
- const fileName = namespaceToFileName(t.suite_title);
11
- return this.opts.javaTests + path_1.default.sep + fileName;
12
- }
13
- formatTest(t) {
14
- const fileParts = t.suite_title.split('.');
15
- t.file = namespaceToFileName(t.suite_title);
16
- t.title = t.title.split('(')[0];
17
- // detect params
18
- const paramMatches = t.title.match(/\[(.*?)\]/g);
19
- if (paramMatches) {
20
- const params = paramMatches.map((_match, index) => `param${index + 1}`);
21
- if (params.length === 1)
22
- params[0] = 'param';
23
- let paramIndex = 0;
24
- t.title = t.title.replace(/: \[(.*?)\]/g, () => {
25
- if (params.length < 2)
26
- return `\${param}`;
27
- const paramName = params[paramIndex] || `param${paramIndex + 1}`;
28
- paramIndex++;
29
- return `\${${paramName}}`;
30
- });
31
- const example = {};
32
- paramMatches.forEach((match, index) => {
33
- example[params[index]] = match.replace(/[[\]]/g, '');
34
- });
35
- t.example = example;
36
- }
37
- t.suite_title = fileParts[fileParts.length - 1].replace(/\$/g, ' | ');
38
- return t;
39
- }
40
- }
41
- function namespaceToFileName(fileName) {
42
- const fileParts = fileName.split('.');
43
- fileParts[fileParts.length - 1] = fileParts[fileParts.length - 1]?.replace(/\$.*/, '');
44
- return `${fileParts.join(path_1.default.sep)}.kt`;
45
- }
46
- module.exports = KotlinAdapter;