angular - ng 测试的包含选项不起作用
问题描述
我正在尝试使用 ng 测试使用 Karma 和 Jasmine 运行单元测试。当我发出以下命令时:
ng test --watch=false --code-coverage --main ./src/main/resources/public/scripts/xyz/workspace/commons/interceptors/mgr.ng.spec.ts
它可以正常工作。
当我尝试使用以下命令运行该目录中的所有脚本时:
ng test --watch=false --code-coverage --include=src/main/resources/public/scripts/xyz/workspace/commons/interceptors/*.ng.spec.ts
我收到以下错误:
Specified patterns: "src/main/resources/public/scripts/xyz/workspace/commons/interceptors/*.ng.spec.ts" did not match any spec files
知道这里发生了什么吗?我尝试了很多变体,但看起来 include 选项根本不起作用。
解决方案
以下是在特定文件夹及其所有子文件夹/子目录下运行测试文件的命令
ng test --include='src/app/modulefolder/**/*.spec.ts'
推荐阅读
- flutter - 切换布尔值
- c# - 无法从“页面”转换为“Xamarin.Forms.Page”
- java - 在 Spring Data Rest 中放置多对多关联
- python - 在 Pyspark 中将纪元时间转换为时间戳
- vtk - 在 Python 中在 VTK 和 ITK 之间交换数据
- cmake - 从 cmake-gui 输出中提取 CMake 命令行
- javascript - 您如何检查新的 youtube 视频何时上传到特定频道
- android - 无法安装 GPU 调试工具 (extras;android;gapid;3) OSX
- c++ - 如何让一个变量依赖于类中的其他变量?
- php - 如何根据 PHP 中的最高数量从多个数组中找到数组?