{"action":"created","issue":{"url":"https://api.github.com/repos/r-lib/testthat/issues/659","repository_url":"https://api.github.com/repos/r-lib/testthat","labels_url":"https://api.github.com/repos/r-lib/testthat/issues/659/labels{/name}","comments_url":"https://api.github.com/repos/r-lib/testthat/issues/659/comments","events_url":"https://api.github.com/repos/r-lib/testthat/issues/659/events","html_url":"https://github.com/r-lib/testthat/issues/659","id":267030954,"node_id":"MDU6SXNzdWUyNjcwMzA5NTQ=","number":659,"title":"Vignette on using testthat outside the context of a package","user":{"login":"jennybc","id":599454,"node_id":"MDQ6VXNlcjU5OTQ1NA==","avatar_url":"https://avatars3.githubusercontent.com/u/599454?v=4","gravatar_id":"","url":"https://api.github.com/users/jennybc","html_url":"https://github.com/jennybc","followers_url":"https://api.github.com/users/jennybc/followers","following_url":"https://api.github.com/users/jennybc/following{/other_user}","gists_url":"https://api.github.com/users/jennybc/gists{/gist_id}","starred_url":"https://api.github.com/users/jennybc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennybc/subscriptions","organizations_url":"https://api.github.com/users/jennybc/orgs","repos_url":"https://api.github.com/users/jennybc/repos","events_url":"https://api.github.com/users/jennybc/events{/privacy}","received_events_url":"https://api.github.com/users/jennybc/received_events","type":"User","site_admin":false},"labels":[{"id":708121848,"node_id":"MDU6TGFiZWw3MDgxMjE4NDg=","url":"https://api.github.com/repos/r-lib/testthat/labels/docs","name":"docs","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-10-20T00:40:47Z","updated_at":"2018-10-16T14:07:13Z","closed_at":null,"author_association":"MEMBER","body":"I taught \"writing functions\" today and showed a bit of testthat. Which overalls feels like a good thing.\r\n\r\nBut I feel there's little guidance on how to use testthat on functions that are not (yet) in a package.\r\n\r\nDo you make a `.R` file that sources the target functions and proceeds to execute lots of expectations, possibly gathered into tests? How do you trigger testing? It's tempting to tell someone that their need to do this suggests the function and its tests should be in a package. Once you've given that advice though, you still need to do something today. But exactly what?\r\n\r\nAnother use case extracted from a student question: An organization has lots of existing scripts. Not necessarily using functions, not necessarily very modular, etc etc. It is what it is. How can you use testthat to start getting more control and visibility into the output of these scripts? Especially, is the output changing as a result of people tinkering with the scripts or upgrading R or upgrading packages? I suspect there's a workflow here using reference objects and reference files."},"comment":{"url":"https://api.github.com/repos/r-lib/testthat/issues/comments/430251311","html_url":"https://github.com/r-lib/testthat/issues/659#issuecomment-430251311","issue_url":"https://api.github.com/repos/r-lib/testthat/issues/659","id":430251311,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDI1MTMxMQ==","user":{"login":"MeyerGrace","id":19607340,"node_id":"MDQ6VXNlcjE5NjA3MzQw","avatar_url":"https://avatars3.githubusercontent.com/u/19607340?v=4","gravatar_id":"","url":"https://api.github.com/users/MeyerGrace","html_url":"https://github.com/MeyerGrace","followers_url":"https://api.github.com/users/MeyerGrace/followers","following_url":"https://api.github.com/users/MeyerGrace/following{/other_user}","gists_url":"https://api.github.com/users/MeyerGrace/gists{/gist_id}","starred_url":"https://api.github.com/users/MeyerGrace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MeyerGrace/subscriptions","organizations_url":"https://api.github.com/users/MeyerGrace/orgs","repos_url":"https://api.github.com/users/MeyerGrace/repos","events_url":"https://api.github.com/users/MeyerGrace/events{/privacy}","received_events_url":"https://api.github.com/users/MeyerGrace/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T14:07:13Z","updated_at":"2018-10-16T14:07:13Z","author_association":"NONE","body":"I was looking for information on this because I have an analysis script which is getting complicated and has the potential to keep growing. I thought that this was a good first step to ensuring reproducible results and making me be purposeful in the file structure. \r\n\r\nI found a nice blog on this ( https://katherinemwood.github.io/post/testthat/) which I took as a guide and implemented but I think it would be nice to have a _recommended_ \"light touch\" framework. \r\n\r\nWhy I'm not making a package now: \r\n- it might not be a useful analysis in the future\r\n- I don't make packages much so would have to re-learn and tinker\r\n- my company has no internal packages so it adds overhead to share/audit at this moment.\r\n"}}
{"actor":{"display_login":"MeyerGrace"}}