@allurereport/reader 3.3.0 → 3.4.0

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 +1,5 @@
1
- import { XMLParser } from "fast-xml-parser";
2
1
  import * as console from "node:console";
2
+ import { XMLParser } from "fast-xml-parser";
3
3
  import { ensureInt, ensureString } from "../utils.js";
4
4
  import { cleanBadXmlCharacters, isStringAnyRecord, isStringAnyRecordArray } from "../xml-utils.js";
5
5
  const DEFAULT_TEST_NAME = "The test's name is not defined";
@@ -66,7 +66,7 @@ const parseRootElement = async (visitor, xml) => {
66
66
  return await parseTestSuite(visitor, testSuite);
67
67
  };
68
68
  const parseTestSuite = async (visitor, testSuite) => {
69
- const { "name": testSuiteName, "title": testSuiteTitle, "description": descriptionElement, "test-cases": testCases, "labels": labelsElement, } = testSuite;
69
+ const { name: testSuiteName, title: testSuiteTitle, description: descriptionElement, "test-cases": testCases, labels: labelsElement, } = testSuite;
70
70
  if (!isStringAnyRecord(testCases)) {
71
71
  return false;
72
72
  }
@@ -1,7 +1,7 @@
1
- import { notNull } from "@allurereport/core-api";
2
- import { XMLParser } from "fast-xml-parser";
3
1
  import * as console from "node:console";
4
2
  import { randomUUID } from "node:crypto";
3
+ import { notNull } from "@allurereport/core-api";
4
+ import { XMLParser } from "fast-xml-parser";
5
5
  import { parseProperties } from "../properties.js";
6
6
  import { ensureBoolean, ensureInt, ensureString } from "../utils.js";
7
7
  import { cleanBadXmlCharacters, isStringAnyRecord, isStringAnyRecordArray } from "../xml-utils.js";
@@ -14,7 +14,7 @@ const xmlParser = new XMLParser({
14
14
  removeNSPrefix: true,
15
15
  allowBooleanAttributes: true,
16
16
  processEntities: false,
17
- isArray: (tagName, jPath) => arrayTags.has(jPath),
17
+ isArray: (tagName, jPath) => arrayTags.has(jPath.toString()),
18
18
  });
19
19
  const readerId = "allure2";
20
20
  export const allure2 = {
@@ -1,6 +1,6 @@
1
- import { BufferResultFile } from "@allurereport/reader-api";
2
1
  import * as console from "node:console";
3
2
  import { randomUUID } from "node:crypto";
3
+ import { BufferResultFile } from "@allurereport/reader-api";
4
4
  import { ensureArray, ensureInt, ensureString, isArray, isNonNullObject, isString } from "../utils.js";
5
5
  import { STEP_NAME_PLACEHOLDER, TEST_NAME_PLACEHOLDER } from "./model.js";
6
6
  const NS_IN_MS = 1000000;
@@ -1,7 +1,7 @@
1
- import { BufferResultFile } from "@allurereport/reader-api";
2
- import { XMLParser } from "fast-xml-parser";
3
1
  import * as console from "node:console";
4
2
  import { randomUUID } from "node:crypto";
3
+ import { BufferResultFile } from "@allurereport/reader-api";
4
+ import { XMLParser } from "fast-xml-parser";
5
5
  import { ensureString } from "../utils.js";
6
6
  import { isEmptyElement, isStringAnyRecord, isStringAnyRecordArray } from "../xml-utils.js";
7
7
  const MS_IN_S = 1000;
@@ -20,7 +20,7 @@ const xmlParser = new XMLParser({
20
20
  removeNSPrefix: true,
21
21
  allowBooleanAttributes: true,
22
22
  processEntities: false,
23
- isArray: (tagName, jPath) => arrayTags.has(jPath),
23
+ isArray: (tagName, jPath) => arrayTags.has(jPath.toString()),
24
24
  });
25
25
  const readerId = "junit";
26
26
  export const junitXml = {
@@ -87,7 +87,7 @@ const parseTestSuite = async (visitor, testSuite, isAggregated) => {
87
87
  }
88
88
  };
89
89
  const parseTestCase = async (visitor, { name: suiteName, suitePackage }, testCase, isAggregated) => {
90
- const { "name": nameAttribute, failure, error, skipped, "classname": classNameAttribute, time, "system-out": systemOutAttribute, "system-err": systemErrAttribute, } = testCase;
90
+ const { name: nameAttribute, failure, error, skipped, classname: classNameAttribute, time, "system-out": systemOutAttribute, "system-err": systemErrAttribute, } = testCase;
91
91
  const name = ensureString(nameAttribute);
92
92
  const className = ensureString(classNameAttribute);
93
93
  const systemOut = ensureString(systemOutAttribute);
@@ -1,7 +1,7 @@
1
- import { invokeStdoutCliTool, isDefined } from "@allurereport/reader-api";
2
1
  import { lstat } from "node:fs/promises";
3
2
  import { platform } from "node:os";
4
3
  import path from "node:path";
4
+ import { invokeStdoutCliTool, isDefined } from "@allurereport/reader-api";
5
5
  const XCODE_INSTALL_URL = "https://developer.apple.com/documentation/safari-developer-tools/installing-xcode-and-simulators";
6
6
  const XCODE_SWITCH_COMMAND = "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer";
7
7
  export const XCRESULTTOOL_MISSING_MESSAGE = `'xcresulttool' is required to parse Xcode Result bundles, but we can't \
@@ -1,5 +1,5 @@
1
- import { isDefined, isNumber } from "@allurereport/reader-api";
2
1
  import { randomUUID } from "node:crypto";
2
+ import { isDefined, isNumber } from "@allurereport/reader-api";
3
3
  export const MS_IN_S = 1000;
4
4
  export const ALLURE_API_ACTIVITY_PREFIX = "allure.";
5
5
  export const statusPriorities = new Map([
@@ -1,5 +1,5 @@
1
- import { collectCliToolStdoutText, invokeCliTool, invokeJsonCliTool, invokeStdoutCliTool, } from "@allurereport/reader-api";
2
1
  import console from "node:console";
2
+ import { collectCliToolStdoutText, invokeCliTool, invokeJsonCliTool, invokeStdoutCliTool, } from "@allurereport/reader-api";
3
3
  export const xcrunJson = async (utilityName, ...args) => {
4
4
  try {
5
5
  return await invokeJsonCliTool("xcrun", [utilityName, ...args], { timeout: 10000 });
@@ -4,8 +4,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _NewApiParser_instances, _NewApiParser_processXcNodes, _NewApiParser_processXcResultNode, _NewApiParser_processXcBundleNode, _NewApiParser_processXcTestSuiteNode, _NewApiParser_processXcTestCaseNode;
7
- import { ensureArray, ensureArrayWithItems, ensureInt, ensureLiteral, ensureObject, ensureString, isArray, isLiteral, isNumber, isObject, isString, } from "@allurereport/reader-api";
8
7
  import { randomUUID } from "node:crypto";
8
+ import { ensureArray, ensureArrayWithItems, ensureInt, ensureLiteral, ensureObject, ensureString, isArray, isLiteral, isNumber, isObject, isString, } from "@allurereport/reader-api";
9
9
  import { DEFAULT_BUNDLE_NAME, DEFAULT_SUITE_NAME, DEFAULT_TEST_NAME, createTestRunLookup, getTargetDetails, lookupNextTestAttempt, secondsToMilliseconds, } from "../utils.js";
10
10
  import { getTestActivities, getTestDetails, getTests } from "./cli.js";
11
11
  import { XcresultParser } from "./model.js";
@@ -125,7 +125,9 @@ const convertXcActivitiesToAllureSteps = async (createAttachmentFile, activities
125
125
  continue;
126
126
  }
127
127
  const stepAttachments = (ensureArrayWithItems(attachments, isObject) ?? [])
128
- .map(({ name, uuid }) => (isString(name) && isString(uuid) ? { potentialNames: getPotentialFileNamesFromXcSuggestedName(name), uuid, xcName: name } : undefined))
128
+ .map(({ name, uuid }) => isString(name) && isString(uuid)
129
+ ? { potentialNames: getPotentialFileNamesFromXcSuggestedName(name), uuid, xcName: name }
130
+ : undefined)
129
131
  .filter((entry) => typeof entry !== "undefined");
130
132
  const { steps: substeps, attachmentFiles: substepAttachmentFiles } = await convertXcActivitiesToAllureSteps(createAttachmentFile, childActivities, stepAttachments.values());
131
133
  const step = {
@@ -10,8 +10,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
12
  var _LegacyApiParser_instances, _LegacyApiParser_xcode16Plus, _LegacyApiParser_legacyCliSucceeded, _LegacyApiParser_noLegacyApi, _LegacyApiParser_traverseActionTestSummaries, _LegacyApiParser_visitActionTestMetadata, _LegacyApiParser_visitActionTestSummary, _LegacyApiParser_visitActionTestSummaryGroup, _LegacyApiParser_processActivities, _LegacyApiParser_processFailures, _LegacyApiParser_parseFailureEntries, _LegacyApiParser_parseExpectedFailureEntries, _LegacyApiParser_toFailureMapEntry, _LegacyApiParser_parseAttachments, _LegacyApiParser_getRoot, _LegacyApiParser_getById, _LegacyApiParser_getFileById, _LegacyApiParser_xcresulttoolGetLegacy;
13
- import { BufferResultFile, ensureObject, isDefined, isObject } from "@allurereport/reader-api";
14
13
  import { randomUUID } from "node:crypto";
14
+ import { BufferResultFile, ensureObject, isDefined, isObject } from "@allurereport/reader-api";
15
15
  import { DEFAULT_BUNDLE_NAME, DEFAULT_EXPECTED_FAILURE_REASON, DEFAULT_STEP_NAME, DEFAULT_SUITE_ID, DEFAULT_SUITE_NAME, DEFAULT_TEST_NAME, applyApiCalls, createTestLabels, getDefaultAttachmentName, getMediaTypeByUti, getTargetDetails, getWorstStatusWithDetails, parseAsAllureApiActivity, prependTitle, secondsToMilliseconds, toSortedSteps, } from "../../utils.js";
16
16
  import { xcresulttool, xcresulttoolBinary } from "../cli.js";
17
17
  import { XcresultParser } from "../model.js";
@@ -1,8 +1,8 @@
1
- import { BufferResultFile } from "@allurereport/reader-api";
2
1
  import console from "node:console";
3
2
  import { mkdtemp, readFile, rm } from "node:fs/promises";
4
3
  import { tmpdir } from "node:os";
5
4
  import path from "node:path";
5
+ import { BufferResultFile } from "@allurereport/reader-api";
6
6
  import { exportAttachments } from "./cli.js";
7
7
  const AUTO_VIDEO_CAPTURE_NAME = "kXCTAttachmentScreenRecording";
8
8
  const AUTO_SCREENSHOT_CAPTURE_NAME = "kXCTAttachmentLegacyScreenImageData";
package/package.json CHANGED
@@ -1,54 +1,43 @@
1
1
  {
2
2
  "name": "@allurereport/reader",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Collection of utilities which helps to process different kind of test results as Allure Results",
5
5
  "keywords": [
6
6
  "allure",
7
7
  "testing"
8
8
  ],
9
- "repository": "https://github.com/allure-framework/allure3",
10
9
  "license": "Apache-2.0",
11
10
  "author": "Qameta Software",
11
+ "repository": "https://github.com/allure-framework/allure3",
12
+ "files": [
13
+ "dist"
14
+ ],
12
15
  "type": "module",
16
+ "module": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
13
18
  "exports": {
14
19
  ".": "./dist/index.js"
15
20
  },
16
- "module": "./dist/index.js",
17
- "types": "./dist/index.d.ts",
18
- "files": [
19
- "dist"
20
- ],
21
21
  "scripts": {
22
22
  "build": "run clean && tsc --project ./tsconfig.json",
23
23
  "clean": "rimraf ./dist",
24
- "eslint": "eslint ./src/**/*.{js,jsx,ts,tsx}",
25
- "eslint:format": "eslint --fix ./src/**/*.{js,jsx,ts,tsx}",
26
- "test": "vitest run"
24
+ "test": "vitest run",
25
+ "lint": "oxlint --import-plugin src test features stories",
26
+ "lint:fix": "oxlint --import-plugin --fix src test features stories"
27
27
  },
28
28
  "dependencies": {
29
- "@allurereport/core-api": "3.3.0",
30
- "@allurereport/plugin-api": "3.3.0",
31
- "@allurereport/reader-api": "3.3.0",
32
- "fast-xml-parser": "^5.3.6"
29
+ "@allurereport/core-api": "3.4.0",
30
+ "@allurereport/plugin-api": "3.4.0",
31
+ "@allurereport/reader-api": "3.4.0",
32
+ "fast-xml-parser": "^5.5.7"
33
33
  },
34
34
  "devDependencies": {
35
- "@stylistic/eslint-plugin": "^2.6.1",
36
35
  "@types/archiver": "^6.0.3",
37
- "@types/eslint": "^8.56.11",
38
36
  "@types/node": "^20.17.9",
39
- "@typescript-eslint/eslint-plugin": "^8.0.0",
40
- "@typescript-eslint/parser": "^8.0.0",
41
37
  "@vitest/runner": "^2.1.9",
42
38
  "allure-js-commons": "^3.3.3",
43
39
  "allure-vitest": "^3.3.3",
44
40
  "archiver": "^7.0.1",
45
- "eslint": "^8.57.0",
46
- "eslint-config-prettier": "^9.1.0",
47
- "eslint-plugin-import": "^2.29.1",
48
- "eslint-plugin-jsdoc": "^50.0.0",
49
- "eslint-plugin-n": "^17.10.1",
50
- "eslint-plugin-no-null": "^1.0.2",
51
- "eslint-plugin-prefer-arrow": "^1.2.3",
52
41
  "rimraf": "^6.0.1",
53
42
  "typescript": "^5.6.3",
54
43
  "vitest": "^2.1.9"