2015-01-12 11 views
2

我有通過Chutzpah上下文菜單擴展(運行JS測試)運行的茉莉花測試。但是它們不會被測試資源管理器發現,當我用鼠標右鍵單擊並選擇運行測試,從「測試」輸出給了我這樣的:Visual Studio Test Explorer不會發現茉莉花測試

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

您可能不想要根路徑(以'/'開頭的路徑),因爲Chutzpah將在您的驅動器根目錄中查找這些文件。 – jessehouwing

+0

謝謝,問題更新。仍然不是修復。 – user1696017

+0

您的解決方案結構如何? – jessehouwing

回答

1

通過將我的測試項目名稱從DIB.MemberCatalog.Tests.JS更改爲DIB.MemberCatalog.Tests.Client來解決。項目在項目名稱末尾有JavaScript文件擴展名時會發生混淆。