Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai e091561937 style(cucumber): format the Python step files 2026-11-21 01:22:20 +08:00
2 змінених файлів з 20 додано та 3 видалено

No files matched your search

+16 -2
Переглянути файл
@@ -1,7 +1,21 @@
import { describe, expect, it } from "vitest";
import { definitionInsertions, matchesStep, snippetStyle, stepDefinitions, stepSnippet, type FeatureStep } from "./steps";
import {
definitionInsertions,
matchesStep,
snippetStyle,
stepDefinitions,
stepSnippet,
type FeatureStep,
} from "./steps";
const step = (text: string): FeatureStep => ({ from: 0, to: 0, keyword: "Given ", type: "Given", text, matchText: text });
const step = (text: string): FeatureStep => ({
from: 0,
to: 0,
keyword: "Given ",
type: "Given",
text,
matchText: text,
});
const apply = (text: string, insertions: { at: number; text: string }[]) =>
[...insertions].sort((a, b) => b.at - a.at).reduce((out, i) => out.slice(0, i.at) + i.text + out.slice(i.at), text);
+4 -1
Переглянути файл
@@ -141,7 +141,10 @@ export function pythonStepSnippet(
const decorator = keyword.toLowerCase();
const quoted = (s: string) => `'${s.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
if (framework === "pytest-bdd")
return { text: [`@${decorator}(${quoted(text)})`, "def _():", " raise NotImplementedError", ""].join("\n"), body: 2 };
return {
text: [`@${decorator}(${quoted(text)})`, "def _():", " raise NotImplementedError", ""].join("\n"),
body: 2,
};
// behave reads the pattern as a `parse` format: braces in the step are literal.
const format = text.replace(/[{}]/g, "$&$&");
return {