我有通过Chutzpah上下文菜单扩展(Run JS tests)运行的jasmine测试。但是,它们不会被测试资源管理器发现,当我右键单击并选择运行测试时,输出来自"测试"给了我这个:
System.ArgumentException: The directory name is invalid.
at System.IO.FileSystemWatcher..ctor(String path, String filter)
at Chutzpah.VS11.EventWatchers.TestFilesUpdateWatcher.AddWatch(String path)
at Chutzpah.VS2012.TestAdapter.ChutzpahTestContainerDiscoverer.UpdateTestContainersAndFileWatchers(IEnumerable`1 files, Boolean isAdd)
at Chutzpah.VS2012.TestAdapter.ChutzpahTestContainerDiscoverer.GetTestContainers()
at Chutzpah.VS2012.TestAdapter.ChutzpahTestContainerDiscoverer.get_TestContainers()
at Microsoft.VisualStudio.TestWindow.Controller.TestContainerDiscovererExtension.GetSortedContainers(ITestContainerDiscoverer discoverer)
at Microsoft.VisualStudio.TestWindow.Controller.TestContainerProvider.GetContainersFromDiscoverer(ITestContainerDiscoverer discoverer)
No tests found to run.
这里还有我的chutzpah.json文件:
{
"Framework": "jasmine",
"FrameworkVersion": "2",
"TestHarnessLocationMode": "SettingsFileAdjacent",
"References": [
{ "Path": "../../DIB.MemberCatalog/lib/dust/dust-full.js" },
{ "Path": "../../DIB.MemberCatalog/lib/dust-helpers/dust-helpers.js" },
{ "Path": "../../DIB.MemberCatalog/lib/harvey/harvey.js" },
{ "Path": "../../DIB.MemberCatalog/lib/hopscotch/js/hopscotch.js" },
{ "Path": "../../DIB.MemberCatalog/lib/jquery/jquery-1.11.1.js" },
{ "Path": "../../DIB.MemberCatalog/lib/jquery-ui/jquery-ui.js" },
{ "Path": "../../DIB.MemberCatalog/lib/jquery-validate/jquery.validate.js" },
{ "Path": "../../DIB.MemberCatalog/lib/knockout/knockout-3.1.0.js" },
{ "Path": "../../DIB.MemberCatalog/lib/knockout-mapping/knockout.mapping.js" },
{ "Path": "../../DIB.MemberCatalog/lib/knockout-validation/knockout.validation.js" },
{ "Path": "../../DIB.MemberCatalog/lib/lightbox/js/lightbox.js" },
{ "Path": "../../DIB.MemberCatalog/lib/respond/respond.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/jquery.qtip.min.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/json2.min.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/jquery.cookie.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/jquery.hoverIntent.min.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/jquery.lazyload.min.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/changecheck.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/stickytable.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/superalert.js" },
{ "Path": "../../DIB.MemberCatalog/Scripts/core.js" },
{ "Path": "prepare.js" },
{ "Path": "engine.js" }
],
"Tests": [
{ "Path": "tests" }
],
"CodeCoverageIncludes": [],
"CodeCoverageExcludes": []
}
Solution structure:
DIB.MemberCatalog
-Testing
- DIB.MemberCatalog.Tests.JS
- data
- lib
- jasmine-2.0.0
- (jasmine files, boot, console, jasmine)
- tests
- testfiles.js
- chutzpah.json
-DIB.MemberCatalog
- (more...)
我已经浏览过互联网,无法找到解决方案。
答案 0 :(得分:1)
通过将我的测试项目名称从DIB.MemberCatalog.Tests.JS更改为DIB.MemberCatalog.Tests.Client来解决此问题。当项目在项目名称末尾有javascript文件扩展名时,就会发生混淆。