{"action":"created","issue":{"url":"https://api.github.com/repos/anticoders/gagarin/issues/130","labels_url":"https://api.github.com/repos/anticoders/gagarin/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/anticoders/gagarin/issues/130/comments","events_url":"https://api.github.com/repos/anticoders/gagarin/issues/130/events","html_url":"https://github.com/anticoders/gagarin/pull/130","id":74001385,"number":130,"title":"use node-glob for file searching","user":{"login":"smeijer","id":1196524,"avatar_url":"https://avatars.githubusercontent.com/u/1196524?v=3","gravatar_id":"","url":"https://api.github.com/users/smeijer","html_url":"https://github.com/smeijer","followers_url":"https://api.github.com/users/smeijer/followers","following_url":"https://api.github.com/users/smeijer/following{/other_user}","gists_url":"https://api.github.com/users/smeijer/gists{/gist_id}","starred_url":"https://api.github.com/users/smeijer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smeijer/subscriptions","organizations_url":"https://api.github.com/users/smeijer/orgs","repos_url":"https://api.github.com/users/smeijer/repos","events_url":"https://api.github.com/users/smeijer/events{/privacy}","received_events_url":"https://api.github.com/users/smeijer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-07T14:13:17Z","updated_at":"2015-05-11T14:14:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/anticoders/gagarin/pulls/130","html_url":"https://github.com/anticoders/gagarin/pull/130","diff_url":"https://github.com/anticoders/gagarin/pull/130.diff","patch_url":"https://github.com/anticoders/gagarin/pull/130.patch"},"body":"I've also updated the readme, so please take a look at it for more examples about why we should use `node-glob` for file lookup.\r\n\r\nTo give you an idea, I like to place my tests in the package they belong to. Let's give an example:\r\n\r\nLet's say my directory structure is like:\r\n```bash\r\nmyBlog\r\n  client\r\n  server\r\n  packages\r\n    blog-acl\r\n      package.js\r\n      client  # blog-acl specific client code\r\n      server  # blog-acl specific server code\r\n      tests   # blog-acl specific tests\r\n        authorized.js\r\n        guests.js\r\n    blog-comments\r\n      # ...\r\n      tests   # blog-comments specific tests\r\n        comments.js\r\n    blog-posts\r\n      # ...\r\n      tests   # blog-posts specific tests\r\n        archive.js\r\n        posts.js\r\n  # ...\r\n  tests       # application scope tests\r\n    accounts.js\r\n```\r\n\r\nWith this PR, the app above can be tested with a single command:\r\n\r\n```bash\r\nd:\\myBlog\\ > gagarin ./**/tests/**/*.js --verbose\r\n```\r\n\r\nresults in:\r\n```bash\r\n system  searching for test files, using glob pattern `./**/tests/**/*.js`\r\n\r\n  --- added => d:\\myBlog\\packages\\blog-acl\\tests\\authorized.js\r\n  --- added => d:\\myBlog\\packages\\blog-acl\\tests\\guests.js\r\n  --- added => d:\\myBlog\\packages\\blog-comments\\tests\\comments.js\r\n  --- added => d:\\myBlog\\packages\\blog-posts\\tests\\archive.js\r\n  --- added => d:\\myBlog\\packages\\blog-posts\\tests\\posts.js\r\n  --- added => d:\\myBlog\\tests\\accounts.js\r\n\r\n  added 6 test files ...\r\n```\r\n\r\nLet me explain: `./**/tests` means, find all folders called `tests`. The `**` means that it doesn't matter if it is in the root, or if it is somewhere deeply nested. A single `*` is a single level wildcard, a double `**` 0 till infinity.\r\n\r\nNext, for each directory named `tests`, find all `.js` files, no matter how deep they are nested in this `tests` folder. Again, due to the double asterisk `**`\r\n\r\nAs gagarin runs outside of meteor, there is no need to mention the tests files in `package.js`, so despite the fact that the tests aren't in the official `tests` folder, they are still not included during the build process. Which is great.\r\n\r\nOf course the whole thing is backwards compatible. So the default fallback is to look for `.js` and `.coffee` files in `./tests/gagarin` and `gagarin` will still accept a file or directory as input to test."},"comment":{"url":"https://api.github.com/repos/anticoders/gagarin/issues/comments/100921428","html_url":"https://github.com/anticoders/gagarin/pull/130#issuecomment-100921428","issue_url":"https://api.github.com/repos/anticoders/gagarin/issues/130","id":100921428,"user":{"login":"smeijer","id":1196524,"avatar_url":"https://avatars.githubusercontent.com/u/1196524?v=3","gravatar_id":"","url":"https://api.github.com/users/smeijer","html_url":"https://github.com/smeijer","followers_url":"https://api.github.com/users/smeijer/followers","following_url":"https://api.github.com/users/smeijer/following{/other_user}","gists_url":"https://api.github.com/users/smeijer/gists{/gist_id}","starred_url":"https://api.github.com/users/smeijer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smeijer/subscriptions","organizations_url":"https://api.github.com/users/smeijer/orgs","repos_url":"https://api.github.com/users/smeijer/repos","events_url":"https://api.github.com/users/smeijer/events{/privacy}","received_events_url":"https://api.github.com/users/smeijer/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T14:14:09Z","updated_at":"2015-05-11T14:14:09Z","body":"@apendua fixing the invalid path's is no problem at all. See PR #131. Rebasing this PR will cost me some time. I'll see if I can find some spare time during this week."}}