@dev-blinq/cucumber_client 1.0.1741-dev → 1.0.1743-dev
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.
|
@@ -1068,24 +1068,25 @@ export async function updateStepDefinitions({ scenario, featureName, projectDir,
|
|
|
1068
1068
|
writeFileSync(utilsFilePath, utilsContent, UTF8_ENCODING);
|
|
1069
1069
|
} catch (error) {
|
|
1070
1070
|
logger.error(
|
|
1071
|
-
"❌ updateStepDefinitions() failed"
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1071
|
+
"❌ updateStepDefinitions() failed" +
|
|
1072
|
+
JSON.stringify(
|
|
1073
|
+
{
|
|
1074
|
+
message: error?.message,
|
|
1075
|
+
meta: error?.meta,
|
|
1076
|
+
stack: error?.stack,
|
|
1077
|
+
},
|
|
1078
|
+
null,
|
|
1079
|
+
2
|
|
1080
|
+
) +
|
|
1081
|
+
"\nStringified error: ❌" +
|
|
1082
|
+
getErrorMessage(error)
|
|
1083
1083
|
);
|
|
1084
1084
|
throw error instanceof UpdateStepDefinitionsError
|
|
1085
1085
|
? error
|
|
1086
1086
|
: new UpdateStepDefinitionsError({
|
|
1087
1087
|
type: SaveJobErrorType.INTERNAL_ERROR,
|
|
1088
1088
|
message: error?.message ?? "Unknown error",
|
|
1089
|
+
meta: error.meta,
|
|
1089
1090
|
});
|
|
1090
1091
|
}
|
|
1091
1092
|
}
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
UpdateStepDefinitionsError,
|
|
9
9
|
UTF8_ENCODING,
|
|
10
10
|
} from "./constants.js";
|
|
11
|
+
import url from "node:url";
|
|
12
|
+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
11
13
|
|
|
12
14
|
export function handleFileInitOps(projectDir, logger) {
|
|
13
15
|
try {
|
|
@@ -26,22 +28,20 @@ export function handleFileInitOps(projectDir, logger) {
|
|
|
26
28
|
FIXED_FOLDER_NAMES.STEP_DEFINITIONS,
|
|
27
29
|
FIXED_FILE_NAMES.UTILS
|
|
28
30
|
);
|
|
29
|
-
console.log("🍊", __dirname, "🍎", process.cwd());
|
|
30
31
|
const utilsTemplateFilePath = path.join(
|
|
31
32
|
__dirname,
|
|
32
33
|
`../../${FIXED_FOLDER_NAMES.ASSETS}`,
|
|
33
34
|
FIXED_FOLDER_NAMES.TEMPLATES,
|
|
34
35
|
FIXED_FILE_NAMES.UTILS_TEMPLATE
|
|
35
36
|
);
|
|
36
|
-
writeFileSync(utilsFilePath, utilsContent, UTF8_ENCODING);
|
|
37
|
-
logger.info("🔆 utilsTemplateFilePath:", utilsTemplateFilePath);
|
|
38
|
-
logger.info("☀️ exists:", existsSync(utilsTemplateFilePath));
|
|
39
37
|
|
|
40
38
|
if (!existsSync(utilsTemplateFilePath)) {
|
|
41
39
|
throw new Error(`Utils template not found at: ${utilsTemplateFilePath}`);
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
const utilsContent = readFileSync(utilsTemplateFilePath, UTF8_ENCODING);
|
|
43
|
+
writeFileSync(utilsFilePath, utilsContent, UTF8_ENCODING);
|
|
44
|
+
|
|
45
45
|
const hooksTemplateFilePath = path.join(
|
|
46
46
|
__dirname,
|
|
47
47
|
`../../${FIXED_FOLDER_NAMES.ASSETS}`,
|
|
@@ -58,18 +58,6 @@ export function handleFileInitOps(projectDir, logger) {
|
|
|
58
58
|
|
|
59
59
|
return { featureFolder, utilsFilePath, utilsContent };
|
|
60
60
|
} catch (error) {
|
|
61
|
-
console.log(
|
|
62
|
-
"🔰🔰🔰🔰🔰🔰",
|
|
63
|
-
JSON.stringify(
|
|
64
|
-
{
|
|
65
|
-
type: SaveJobErrorType.FILE_SYSTEM_ERROR,
|
|
66
|
-
message: "❌ Failed to initialize step definition folder structure",
|
|
67
|
-
meta: { reason: getErrorMessage(error) },
|
|
68
|
-
},
|
|
69
|
-
null,
|
|
70
|
-
2
|
|
71
|
-
)
|
|
72
|
-
);
|
|
73
61
|
throw new UpdateStepDefinitionsError({
|
|
74
62
|
type: SaveJobErrorType.FILE_SYSTEM_ERROR,
|
|
75
63
|
message: "❌ Failed to initialize step definition folder structure",
|