@allurereport/core 3.0.0-beta.5 → 3.0.0-beta.7
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.
- package/dist/store/convert.js +6 -3
- package/dist/store/store.d.ts +1 -1
- package/dist/store/store.js +3 -4
- package/package.json +12 -12
package/dist/store/convert.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { notNull } from "@allurereport/core-api";
|
|
2
2
|
import { findByLabelName } from "@allurereport/core-api";
|
|
3
3
|
import { md5 } from "@allurereport/plugin-api";
|
|
4
|
+
import { extension, lookupContentType } from "@allurereport/reader-api";
|
|
4
5
|
import MarkdownIt from "markdown-it";
|
|
5
6
|
import { randomUUID } from "node:crypto";
|
|
6
|
-
import { extname } from "node:path";
|
|
7
7
|
const defaultStatus = "unknown";
|
|
8
8
|
export const __unknown = "#___unknown_value___#";
|
|
9
9
|
export const testFixtureResultRawToState = (stateData, raw, context) => {
|
|
@@ -102,12 +102,14 @@ const processAttachmentLink = ({ attachments, visitAttachmentLink }, attach) =>
|
|
|
102
102
|
const id = md5(attach.originalFileName);
|
|
103
103
|
const previous = attachments.get(id);
|
|
104
104
|
if (!previous) {
|
|
105
|
+
const contentType = attach.contentType ?? lookupContentType(attach.originalFileName);
|
|
106
|
+
const ext = extension(attach.originalFileName, contentType) ?? "";
|
|
105
107
|
const linkExpected = {
|
|
106
108
|
id,
|
|
107
109
|
originalFileName: attach.originalFileName,
|
|
108
|
-
ext
|
|
110
|
+
ext,
|
|
109
111
|
name: attach.name ?? attach.originalFileName,
|
|
110
|
-
contentType
|
|
112
|
+
contentType,
|
|
111
113
|
used: true,
|
|
112
114
|
missed: true,
|
|
113
115
|
};
|
|
@@ -131,6 +133,7 @@ const processAttachmentLink = ({ attachments, visitAttachmentLink }, attach) =>
|
|
|
131
133
|
id,
|
|
132
134
|
name: attach.name ?? previous.originalFileName,
|
|
133
135
|
contentType: attach.contentType ?? previous.contentType,
|
|
136
|
+
ext: extension(previous.originalFileName, attach.contentType) ?? previous.ext ?? "",
|
|
134
137
|
contentLength: previous.contentLength,
|
|
135
138
|
used: true,
|
|
136
139
|
missed: false,
|
package/dist/store/store.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class DefaultAllureStore implements AllureStore, ResultsVisitor {
|
|
|
15
15
|
constructor(history?: HistoryDataPoint[], known?: KnownTestFailure[], eventEmitter?: EventEmitter<AllureStoreEvents>);
|
|
16
16
|
visitTestResult(raw: RawTestResult, context: ReaderContext): Promise<void>;
|
|
17
17
|
visitTestFixtureResult(result: RawFixtureResult, context: ReaderContext): Promise<void>;
|
|
18
|
-
visitAttachmentFile(resultFile: ResultFile): Promise<void>;
|
|
18
|
+
visitAttachmentFile(resultFile: ResultFile, context: ReaderContext): Promise<void>;
|
|
19
19
|
visitMetadata(metadata: RawMetadata): Promise<void>;
|
|
20
20
|
allTestCases(): Promise<TestCase[]>;
|
|
21
21
|
allTestResults(options?: {
|
package/dist/store/store.js
CHANGED
|
@@ -12,7 +12,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
12
12
|
var _DefaultAllureStore_testResults, _DefaultAllureStore_attachments, _DefaultAllureStore_attachmentContents, _DefaultAllureStore_testCases, _DefaultAllureStore_metadata, _DefaultAllureStore_history, _DefaultAllureStore_known, _DefaultAllureStore_fixtures, _DefaultAllureStore_eventEmitter;
|
|
13
13
|
import { compareBy, nullsLast, ordinal, reverse } from "@allurereport/core-api";
|
|
14
14
|
import { md5 } from "@allurereport/plugin-api";
|
|
15
|
-
import { extname } from "node:path";
|
|
16
15
|
import { testFixtureResultRawToState, testResultRawToState } from "./convert.js";
|
|
17
16
|
const index = (indexMap, key, ...items) => {
|
|
18
17
|
if (key) {
|
|
@@ -93,7 +92,7 @@ export class DefaultAllureStore {
|
|
|
93
92
|
index(this.indexAttachmentByFixture, testFixtureResult.id, ...attachmentLinks);
|
|
94
93
|
__classPrivateFieldGet(this, _DefaultAllureStore_eventEmitter, "f")?.emit("testFixtureResult", testFixtureResult.id);
|
|
95
94
|
}
|
|
96
|
-
async visitAttachmentFile(resultFile) {
|
|
95
|
+
async visitAttachmentFile(resultFile, context) {
|
|
97
96
|
const originalFileName = resultFile.getOriginalFileName();
|
|
98
97
|
const id = md5(originalFileName);
|
|
99
98
|
__classPrivateFieldGet(this, _DefaultAllureStore_attachmentContents, "f").set(id, resultFile);
|
|
@@ -101,7 +100,7 @@ export class DefaultAllureStore {
|
|
|
101
100
|
if (maybeLink) {
|
|
102
101
|
const link = maybeLink;
|
|
103
102
|
link.missed = false;
|
|
104
|
-
link.ext = link
|
|
103
|
+
link.ext = link.ext === undefined || link.ext === "" ? resultFile.getExtension() : link.ext;
|
|
105
104
|
link.contentType = link.contentType ?? resultFile.getContentType();
|
|
106
105
|
link.contentLength = resultFile.getContentLength();
|
|
107
106
|
}
|
|
@@ -111,7 +110,7 @@ export class DefaultAllureStore {
|
|
|
111
110
|
missed: false,
|
|
112
111
|
id,
|
|
113
112
|
originalFileName,
|
|
114
|
-
ext:
|
|
113
|
+
ext: resultFile.getExtension(),
|
|
115
114
|
contentType: resultFile.getContentType(),
|
|
116
115
|
contentLength: resultFile.getContentLength(),
|
|
117
116
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/core",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.7",
|
|
4
4
|
"description": "Collection of generic Allure utilities used across the entire project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure"
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"test": "vitest run"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
29
|
-
"@allurereport/plugin-api": "3.0.0-beta.
|
|
30
|
-
"@allurereport/plugin-awesome": "3.0.0-beta.
|
|
31
|
-
"@allurereport/plugin-classic": "3.0.0-beta.
|
|
32
|
-
"@allurereport/plugin-csv": "3.0.0-beta.
|
|
33
|
-
"@allurereport/plugin-log": "3.0.0-beta.
|
|
34
|
-
"@allurereport/plugin-progress": "3.0.0-beta.
|
|
35
|
-
"@allurereport/plugin-slack": "3.0.0-beta.
|
|
36
|
-
"@allurereport/plugin-testplan": "3.0.0-beta.
|
|
37
|
-
"@allurereport/reader": "3.0.0-beta.
|
|
38
|
-
"@allurereport/reader-api": "3.0.0-beta.
|
|
28
|
+
"@allurereport/core-api": "3.0.0-beta.7",
|
|
29
|
+
"@allurereport/plugin-api": "3.0.0-beta.7",
|
|
30
|
+
"@allurereport/plugin-awesome": "3.0.0-beta.7",
|
|
31
|
+
"@allurereport/plugin-classic": "3.0.0-beta.7",
|
|
32
|
+
"@allurereport/plugin-csv": "3.0.0-beta.7",
|
|
33
|
+
"@allurereport/plugin-log": "3.0.0-beta.7",
|
|
34
|
+
"@allurereport/plugin-progress": "3.0.0-beta.7",
|
|
35
|
+
"@allurereport/plugin-slack": "3.0.0-beta.7",
|
|
36
|
+
"@allurereport/plugin-testplan": "3.0.0-beta.7",
|
|
37
|
+
"@allurereport/reader": "3.0.0-beta.7",
|
|
38
|
+
"@allurereport/reader-api": "3.0.0-beta.7",
|
|
39
39
|
"markdown-it": "^14.1.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|