我一直在尝试使用带有多个步骤文件的黄瓜无济于事。 我正在使用带有命令的打字稿步骤定义:
./node_modules/.bin/cucumber-js src --require src/steps/*.steps.ts --require-module ts-node/register
但是随后会弹出一个错误:
错误:(1:1):预期:#EOF、#Language、#TagLine、#FeatureLine、#Comment、#Empty,从“黄瓜”得到“import { CallbackStepDefinition as CB, Given, When, Then };”
我在program.parse(args)之后将 console.log 放在lib/cli/argv_parser.js 中,它输出:
['src','src/steps/example2.steps.ts']
显然,第二步文件被错误地作为特征文件提供。
我在这里包含了一个最小可复制的存储库: https :
你能试一下吗
./node_modules/.bin/cucumber-js src --require 'src/steps/*.steps.ts' --require-module ts-node/register
glob 周围的引号防止它被你的 shell 扩展。
@charlierudolph这创造了奇迹:) 非常感谢。
该线程已被自动锁定,因为它关闭后没有任何最近的活动。 请针对相关错误打开一个新问题。
最有用的评论
你能试一下吗
glob 周围的引号防止它被你的 shell 扩展。