Cucumber (Gherkin) 完全支持无法识别 WSL2 中的步骤

Cucumber (Gherkin) Full Support does not recognize steps in WSL2

提问人:Daniel Mendonça 提问时间:9/28/2023 更新时间:11/3/2023 访问量:30

问:

我有一个 angular 项目和一个柏树测试设置。我目前正在使用 ubuntu wsl2,并且该项目已克隆在那里。

测试要么我在 Windows fs 中克隆并在 WSL 中运行项目。(

现在,当我在 Windows 上的 vscode 中打开项目时,我可以导航到这些步骤。如果我在 wsl 中打开 vscode 并在那里使用项目,那么导航将不起作用。

我环顾四周,没有找到任何特定于 WSL 的设置步骤。有人知道是否可以使用 wsl 使其工作吗?

visual-studio-code wsl-2 cypress-cucumber-preprocessor

评论


答:

0赞 ns.altun 11/3/2023 #1

安装这个“https://marketplace.visualstudio.com/items?itemName=stevejpurves.cucumber”

在“.vscode”下创建settings.json文件。它应该包括以下几行。

{
    "cucumberautocomplete.steps": [
        "local-tests/features/step_definitions/*.js",
        "local-tests/node_modules/@extlib/*.js",
        "local-tests/node_modules/extlib/subfolder/*.mjs"
    ],
    "cucumberautocomplete.strictGherkinCompletion": true,
    "cucumberautocomplete.syncfeatures": "local-tests/features/*feature",
    "editor.quickSuggestions":{
        "strings": "on"
    }
}