@testomatio/reporter 2.9.1-beta.4-allure-step-status → 2.9.2

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,48 +0,0 @@
1
- import path from 'path';
2
- import Adapter from './adapter.js';
3
-
4
- class KotlinAdapter extends Adapter {
5
- getFilePath(t) {
6
- const fileName = namespaceToFileName(t.suite_title);
7
- return this.opts.javaTests + path.sep + fileName;
8
- }
9
-
10
- formatTest(t) {
11
- const fileParts = t.suite_title.split('.');
12
-
13
- t.file = namespaceToFileName(t.suite_title);
14
- t.title = t.title.split('(')[0];
15
-
16
- // detect params
17
- const paramMatches = t.title.match(/\[(.*?)\]/g);
18
-
19
- if (paramMatches) {
20
- const params = paramMatches.map((_match, index) => `param${index + 1}`);
21
- if (params.length === 1) params[0] = 'param';
22
- let paramIndex = 0;
23
-
24
- t.title = t.title.replace(/: \[(.*?)\]/g, () => {
25
- if (params.length < 2) return `\${param}`;
26
- const paramName = params[paramIndex] || `param${paramIndex + 1}`;
27
- paramIndex++;
28
- return `\${${paramName}}`;
29
- });
30
- const example = {};
31
- paramMatches.forEach((match, index) => {
32
- example[params[index]] = match.replace(/[[\]]/g, '');
33
- });
34
- t.example = example;
35
- }
36
-
37
- t.suite_title = fileParts[fileParts.length - 1].replace(/\$/g, ' | ');
38
- return t;
39
- }
40
- }
41
-
42
- function namespaceToFileName(fileName) {
43
- const fileParts = fileName.split('.');
44
- fileParts[fileParts.length - 1] = fileParts[fileParts.length - 1]?.replace(/\$.*/, '');
45
- return `${fileParts.join(path.sep)}.kt`;
46
- }
47
-
48
- export default KotlinAdapter;