yeoman-test 找不到子生成器

问题描述

我使用 typescript 创建了一个生成器,该生成器使用了一个使用子生成器的子生成器(使用 composeWith 子句):

configuring(){
  this.composeWith('mygen:sub',options)
}

我正在尝试使用 yeoman-test(打字稿...)测试我的生成器:

await run(path.join(__dirname,'../generators/app'),{})
            .inDir('./temp-templates')
            .withPrompts({
                serviceName: 'my service',})
            .withGenerators([path.join(__dirname,'../generators/sub/')]);

当我运行测试时它失败并显示错误 You don't seem to have a generator with the name “mygen:sub” installed.

当我使用 CLI 运行我的生成器时,它按预期工作。 当我尝试调试我的测试时,我注意到命名空间解析不正确,而不是将子生成器命名空间计算为 mygen:sub,而是将其计算为 path:to:mygen:sub 附近有吗?

我正在使用:

自耕农发电机:4.13.0, 自耕农测试:4.0.2

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)