Skip to content

Commit

Permalink
fix(commons): invalid reference to properties.d.ts in dist/types/sdk/…
Browse files Browse the repository at this point in the history
…reporter/utils.d.ts of allure-js-commons (#1162)
  • Loading branch information
delatrie authored Oct 2, 2024
1 parent e3c5f29 commit f38b0e7
Show file tree
Hide file tree
Showing 13 changed files with 486 additions and 66 deletions.
12 changes: 0 additions & 12 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
6 changes: 3 additions & 3 deletions packages/allure-cypress/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises"
import { dirname, join, relative, resolve as resolvePath } from "node:path";
import type { TestResult, TestResultContainer } from "allure-js-commons";
import { ContentType, attachment, step } from "allure-js-commons";
import type { AllureResults, EnvironmentInfo } from "allure-js-commons/sdk";
import { getPosixPath, parseProperties } from "allure-js-commons/sdk/reporter";
import type { AllureResults } from "allure-js-commons/sdk";
import { getPosixPath, parseEnvInfo } from "allure-js-commons/sdk/reporter";

type AllureCypressPaths = {
allureCommonsModulePath: string;
Expand Down Expand Up @@ -184,7 +184,7 @@ export const runCypressInlineTest = async (
if (resultFile === "environment.properties") {
const content = await readFile(fullPath, "utf8");
await attachment(resultFile, content, ContentType.TEXT);
res.envInfo = parseProperties(content) as EnvironmentInfo;
res.envInfo = parseEnvInfo(content);
continue;
}

Expand Down
3 changes: 1 addition & 2 deletions packages/allure-js-commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
"test": "vitest run"
},
"dependencies": {
"md5": "^2.3.0",
"properties": "^1.2.1"
"md5": "^2.3.0"
},
"devDependencies": {
"@babel/cli": "^7.24.6",
Expand Down
1 change: 1 addition & 0 deletions packages/allure-js-commons/src/sdk/reporter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ export {
getLanguageLabel,
getFrameworkLabel,
} from "./utils/labels.js";
export { parseEnvInfo, stringifyEnvInfo } from "./utils/envInfo.js";
4 changes: 0 additions & 4 deletions packages/allure-js-commons/src/sdk/reporter/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import fs from "node:fs";
import { readFile } from "node:fs/promises";
import path from "node:path";
import process from "node:process";
import properties from "properties";
import type { Label, Link, Status, StepResult, TestResult } from "../../model.js";
import { LabelName, LinkType, StatusByPriority } from "../../model.js";
import type { LinkConfig, LinkTemplate } from "./types.js";
Expand Down Expand Up @@ -166,9 +165,6 @@ export const escapeRegExp = (value: string): string => {
return reHasRegExpChar.test(value) ? value.replace(reRegExpChar, "\\$&") : value;
};

export const parseProperties = properties.parse;
export const stringifyProperties = (data: any): string => properties.stringify(data, { unicode: true }).toString();

// TODO: may also use URL.canParse instead (requires node.js v18.17, v19.9, or higher)
const isUrl = (potentialUrl: string) => {
// Short-circuits the check for many short URL cases, bypassing the try-catch logic.
Expand Down
Loading

0 comments on commit f38b0e7

Please sign in to comment.