{"action":"created","issue":{"url":"https://api.github.com/repos/mmanela/chutzpah/issues/428","labels_url":"https://api.github.com/repos/mmanela/chutzpah/issues/428/labels{/name}","comments_url":"https://api.github.com/repos/mmanela/chutzpah/issues/428/comments","events_url":"https://api.github.com/repos/mmanela/chutzpah/issues/428/events","html_url":"https://github.com/mmanela/chutzpah/issues/428","id":115903014,"number":428,"title":"Test discovery fails if JS tests reside in project with .js. in name","user":{"login":"objarni","id":68198,"avatar_url":"https://avatars.githubusercontent.com/u/68198?v=3","gravatar_id":"","url":"https://api.github.com/users/objarni","html_url":"https://github.com/objarni","followers_url":"https://api.github.com/users/objarni/followers","following_url":"https://api.github.com/users/objarni/following{/other_user}","gists_url":"https://api.github.com/users/objarni/gists{/gist_id}","starred_url":"https://api.github.com/users/objarni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objarni/subscriptions","organizations_url":"https://api.github.com/users/objarni/orgs","repos_url":"https://api.github.com/users/objarni/repos","events_url":"https://api.github.com/users/objarni/events{/privacy}","received_events_url":"https://api.github.com/users/objarni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-09T15:44:02Z","updated_at":"2015-11-12T09:25:43Z","closed_at":null,"body":"It seems the Discovery process of Chutzpah fails if the project containing the JS test has a name with \"JS\" (or possibly \".JS.\") in it.\r\n\r\nHere is the output in Output/Tests window of VS2015:\r\n\r\n````\r\n----- Discover test started ------\r\nError: Timeout occurred when executing test file\r\nWhile Running:c:\\CENSORED\\development-branches\\dev-vs15-olof\\src\\projects\\CENSORED.web.ui.js.test\\tests\\testchutzpah.js\r\n\r\n========== Discover test finished: 0 found (0:00:12,206) ==========\r\n```\r\nNote path of project: **CENSORED.web.ui.js.test**.\r\n\r\nRelevant section of **%temp%\\chutzpah.log:**\r\n\r\n```\r\nvstest.discoveryengine.x86.exe Information: 0 : Time:16:34:18.6252807; Thread:11; Message:Phantom Log - onPageLoaded\r\nvstest.discoveryengine.x86.exe Error: 0 : Time:16:34:18.6332807; Thread:11; Message:Eror recieved from Phantom Error opening c:/CENSORED/development-branches/dev-vs15-olof/src/projects/CENSORED.web.ui.test/tests/testchutzpah.js: The system cannot find the path specified.\r\n```\r\n\r\nNotice how the project name, **CENSORED.web.ui.test** does not contain \".js\" anymore!\r\n\r\nMy guess is that something inside of Chutzpah/Test adapter (or possibly the Visual Studio test discovery subsystem) assumes Visual Studio project names do not contain \".js\" in them - maybe even doing some \"string\".replace(\".js\", \"\") hack somewhere? :)\r\n\r\nWorkaround\r\n==========\r\nRename test project to something that does not contain \".js.\" in the name, both project name and physical path.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mmanela/chutzpah/issues/comments/156044998","html_url":"https://github.com/mmanela/chutzpah/issues/428#issuecomment-156044998","issue_url":"https://api.github.com/repos/mmanela/chutzpah/issues/428","id":156044998,"user":{"login":"objarni","id":68198,"avatar_url":"https://avatars.githubusercontent.com/u/68198?v=3","gravatar_id":"","url":"https://api.github.com/users/objarni","html_url":"https://github.com/objarni","followers_url":"https://api.github.com/users/objarni/followers","following_url":"https://api.github.com/users/objarni/following{/other_user}","gists_url":"https://api.github.com/users/objarni/gists{/gist_id}","starred_url":"https://api.github.com/users/objarni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objarni/subscriptions","organizations_url":"https://api.github.com/users/objarni/orgs","repos_url":"https://api.github.com/users/objarni/repos","events_url":"https://api.github.com/users/objarni/events{/privacy}","received_events_url":"https://api.github.com/users/objarni/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T09:25:43Z","updated_at":"2015-11-12T09:25:43Z","body":"I forked your repo and reproduced problem by using Jasmine + AMD test harness loading.\r\n\r\nhttps://github.com/objarni/repro_chutzpahDottedPath\r\n\r\nHowever, I'm not 100% this the same problem as I had in real solution. I looked around in the Chutzpah source, and found this function in part of the jasmine test loader functionality:\r\n\r\n```javascript\r\n        collectPageScripts: function(){\r\n            var toArray = Array.prototype.slice;\r\n            var scripts = toArray.call(document.scripts);\r\n            var selectedScripts=[],scriptNames=[];\r\n            var filter = _blanket.options(\"filter\");\r\n            if(filter != null){\r\n                //global filter in place, data-cover-only\r\n                var antimatch = _blanket.options(\"antifilter\");\r\n                selectedScripts = toArray.call(document.scripts)\r\n                                .filter(function(s){\r\n                                    return toArray.call(s.attributes).filter(function(sn){\r\n                                        return sn.nodeName === \"src\" && _blanket.utils.matchPatternAttribute(sn.nodeValue,filter) &&\r\n                                            (typeof antimatch === \"undefined\" || !_blanket.utils.matchPatternAttribute(sn.nodeValue,antimatch));\r\n                                    }).length === 1;\r\n                                });\r\n            }else{\r\n                selectedScripts = toArray.call(document.querySelectorAll(\"script[data-cover]\"));\r\n            }\r\n            scriptNames = selectedScripts.map(function(s){\r\n                                    return _blanket.utils.qualifyURL(\r\n                                        toArray.call(s.attributes).filter(\r\n                                            function(sn){\r\n                                                return sn.nodeName === \"src\";\r\n                                            })[0].nodeValue).replace(\".js\",\"\");\r\n                                    });\r\n            if (!filter){\r\n                _blanket.options(\"filter\",\"['\"+scriptNames.join(\"','\")+\"']\");\r\n            }\r\n            return scriptNames;\r\n        },\r\n```\r\n\r\nThere is a replace(\".js\", \"\") in there - would it not replace all parts of a path, e.g. if '.js' was part of a folder name?"}}