{"action":"created","issue":{"url":"https://api.github.com/repos/mike-thompson-day8/cljsbuild-none-test-seed/issues/2","labels_url":"https://api.github.com/repos/mike-thompson-day8/cljsbuild-none-test-seed/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mike-thompson-day8/cljsbuild-none-test-seed/issues/2/comments","events_url":"https://api.github.com/repos/mike-thompson-day8/cljsbuild-none-test-seed/issues/2/events","html_url":"https://github.com/mike-thompson-day8/cljsbuild-none-test-seed/issues/2","id":51033193,"number":2,"title":"Can this be used with notify-command?","user":{"login":"sir-pinecone","id":40753,"avatar_url":"https://avatars.githubusercontent.com/u/40753?v=3","gravatar_id":"","url":"https://api.github.com/users/sir-pinecone","html_url":"https://github.com/sir-pinecone","followers_url":"https://api.github.com/users/sir-pinecone/followers","following_url":"https://api.github.com/users/sir-pinecone/following{/other_user}","gists_url":"https://api.github.com/users/sir-pinecone/gists{/gist_id}","starred_url":"https://api.github.com/users/sir-pinecone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sir-pinecone/subscriptions","organizations_url":"https://api.github.com/users/sir-pinecone/orgs","repos_url":"https://api.github.com/users/sir-pinecone/repos","events_url":"https://api.github.com/users/sir-pinecone/events{/privacy}","received_events_url":"https://api.github.com/users/sir-pinecone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-04T21:43:08Z","updated_at":"2015-01-03T13:46:20Z","closed_at":null,"body":"I want the tests to auto-run after they are compiled. I see in clojurescript.test that this can be done using `:notify-command` in the cljsbuild config. \r\n\r\nI haven't had much luck getting it to work with your setup. I removed `:test-commands` and added in:\r\n\r\n> :notify-command [\"phantomjs\" \"test/bin/runner-none.js\" \"compiled/test\" \"compiled/test.js\"]\r\n\r\nThen I ran `lein cljsbuild auto test` and saved a file. Results in the error: \r\n\r\n> ERROR: SyntaxError: Parse error\r\n> STACK TRACE:\r\n> Possible cause: the namespace cemerick.cljs.test isn't defined.\r\n> To resolve: ensure [cemerick.cljs.test] appears in the :require clause of your test suite. Also, ensure there's one or more test files.\r\n\r\nAny ideas? \r\n\r\np.s. I kinda don't mind using the test.html approach with figwheel if the above stuff is not possible. But I'm not sure how I would get the test page to refresh after my code compiles. I'm a noob! :]"},"comment":{"url":"https://api.github.com/repos/mike-thompson-day8/cljsbuild-none-test-seed/issues/comments/68595431","html_url":"https://github.com/mike-thompson-day8/cljsbuild-none-test-seed/issues/2#issuecomment-68595431","issue_url":"https://api.github.com/repos/mike-thompson-day8/cljsbuild-none-test-seed/issues/2","id":68595431,"user":{"login":"pjagielski","id":513361,"avatar_url":"https://avatars.githubusercontent.com/u/513361?v=3","gravatar_id":"","url":"https://api.github.com/users/pjagielski","html_url":"https://github.com/pjagielski","followers_url":"https://api.github.com/users/pjagielski/followers","following_url":"https://api.github.com/users/pjagielski/following{/other_user}","gists_url":"https://api.github.com/users/pjagielski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjagielski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjagielski/subscriptions","organizations_url":"https://api.github.com/users/pjagielski/orgs","repos_url":"https://api.github.com/users/pjagielski/repos","events_url":"https://api.github.com/users/pjagielski/events{/privacy}","received_events_url":"https://api.github.com/users/pjagielski/received_events","type":"User","site_admin":false},"created_at":"2015-01-03T13:46:20Z","updated_at":"2015-01-03T13:46:20Z","body":"The problem is in this part of `runner-none.js`:\r\n```javascript\r\nfor (var i = 3; i < system.args.length; i++) {\r\n    var arg = system.args[i];\r\n    if (fs.exists(arg)) {\r\n        if (!page.injectJs(arg))\r\n          throw new Error(\"Failed to inject \" + arg);\r\n     } else {\r\n         page.evaluateJavaScript(\"(function () { \" + arg + \";\" + \" })\");\r\n    }\r\n}\r\n```\r\nThe `notify-command` hook passes \"Successfully compiled \"compiled/test.js\" in 0.177 seconds.\" as last arg of phantomjs invocation and runner-none.js treats is as a valid javascript code.\r\n\r\nUncommenting the `else` branch from the code above worked for me."}}