{"action":"created","issue":{"url":"https://api.github.com/repos/electron/spectron/issues/127","repository_url":"https://api.github.com/repos/electron/spectron","labels_url":"https://api.github.com/repos/electron/spectron/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/electron/spectron/issues/127/comments","events_url":"https://api.github.com/repos/electron/spectron/issues/127/events","html_url":"https://github.com/electron/spectron/issues/127","id":179876733,"number":127,"title":"Default example doesn't work on windows machine. ","user":{"login":"etiennejcharles","id":2872476,"avatar_url":"https://avatars.githubusercontent.com/u/2872476?v=3","gravatar_id":"","url":"https://api.github.com/users/etiennejcharles","html_url":"https://github.com/etiennejcharles","followers_url":"https://api.github.com/users/etiennejcharles/followers","following_url":"https://api.github.com/users/etiennejcharles/following{/other_user}","gists_url":"https://api.github.com/users/etiennejcharles/gists{/gist_id}","starred_url":"https://api.github.com/users/etiennejcharles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etiennejcharles/subscriptions","organizations_url":"https://api.github.com/users/etiennejcharles/orgs","repos_url":"https://api.github.com/users/etiennejcharles/repos","events_url":"https://api.github.com/users/etiennejcharles/events{/privacy}","received_events_url":"https://api.github.com/users/etiennejcharles/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-28T20:14:34Z","updated_at":"2016-10-10T07:14:24Z","closed_at":null,"body":"Thanks for the great tool there !\r\n\r\nWhen I install mocha, and run the default example, it doesn't work on my windows machine, \r\nIn order for it to work I had to do the 2 things.\r\n\r\n1) Get the Electron Path\r\n2) Also add the default path to my Electron App as a First Argument. \r\n\r\nShouldn't  the default example include that ? \r\ni.e\r\n\r\n\r\n```\r\nvar Application = require('spectron').Application;\r\nvar assert      = require('assert');\r\nvar path        = require('path');\r\n\r\n\r\ndescribe('application launch', ()=> {\r\n\tthis.timeout(10000)\r\n\r\n\tbeforeEach(()=> {\r\n\t\tthis.app = new Application({\r\n\t\t\tpath: getElectronPath(),\r\n\t\t\targs: [path.join(__dirname, '..')]\r\n\t\t})\r\n\t\treturn this.app.start();\r\n\t});\r\n\r\n\tafterEach(()=> {\r\n\t\tif (this.app && this.app.isRunning()) {\r\n\t\t\treturn this.app.stop()\r\n\t\t}\r\n\t})\r\n\r\n\r\n\tit('shows an initial window', ()=> {\r\n\t\treturn this.app.client.getWindowCount().then(function (count) {\r\n\t\t\tassert.equal(count, 1)\r\n\t\t});\r\n\t})\r\n\r\n\tfunction getElectronPath() {\r\n\t\tlet electronPath = path.join(__dirname, '..', 'node_modules', '.bin', 'electron');\r\n\t\tif (process.platform === 'win32')  electronPath += '.cmd';\r\n\t\treturn electronPath;\r\n\t}\r\n});\r\n```\r\n\r\nI would gladly do a PR if  you agree necessary\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/electron/spectron/issues/comments/252549130","html_url":"https://github.com/electron/spectron/issues/127#issuecomment-252549130","issue_url":"https://api.github.com/repos/electron/spectron/issues/127","id":252549130,"user":{"login":"hovancik","id":4745859,"avatar_url":"https://avatars.githubusercontent.com/u/4745859?v=3","gravatar_id":"","url":"https://api.github.com/users/hovancik","html_url":"https://github.com/hovancik","followers_url":"https://api.github.com/users/hovancik/followers","following_url":"https://api.github.com/users/hovancik/following{/other_user}","gists_url":"https://api.github.com/users/hovancik/gists{/gist_id}","starred_url":"https://api.github.com/users/hovancik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hovancik/subscriptions","organizations_url":"https://api.github.com/users/hovancik/orgs","repos_url":"https://api.github.com/users/hovancik/repos","events_url":"https://api.github.com/users/hovancik/events{/privacy}","received_events_url":"https://api.github.com/users/hovancik/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T07:14:24Z","updated_at":"2016-10-10T07:14:24Z","body":"There is a better way: https://github.com/electron/spectron/issues/86\r\n\r\n```\r\n\r\nlet electronPath = require('electron')\r\n....\r\n\r\n    this.app = new Application({\r\n      path: electronPath,\r\n      args: [\r\n        path.join(__dirname, '..', 'app')\r\n      ]\r\n    })\r\n\r\n```"}}
{"actor":{"display_login":"hovancik"}}