在Requier.context test.ts中仅设置一个单元测试
我试图在所需的上下文中设置一个单个规格:
const context = require.context('./', true, /my-element.component\.spec\.ts$/);
但是它在该路径中找不到任何规格,但是如果我将上下文作为默认值留下上下文,则可以找到它!
默认值:const Context = require.context('./',true,/\。spec \ .ts $/);
有人可以帮助我吗?
I am trying to set up a single spec in the required context as follows:
const context = require.context('./', true, /my-element.component\.spec\.ts$/);
But it is not finding any spec in that path, however if I leave the context as default, it finds it!
DEFAULT: const context = require.context('./', true, /\.spec\.ts$/);
Can someone help me with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否只是错过逃脱
组件
前面的点?Did you just miss to escape the dot in front of
component
?