{"action":"created","issue":{"url":"https://api.github.com/repos/jhollingworth/marty/issues/270","labels_url":"https://api.github.com/repos/jhollingworth/marty/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/jhollingworth/marty/issues/270/comments","events_url":"https://api.github.com/repos/jhollingworth/marty/issues/270/events","html_url":"https://github.com/jhollingworth/marty/issues/270","id":67209909,"number":270,"title":"Confused about how to write unit tests","user":{"login":"johnytex","id":1251574,"avatar_url":"https://avatars.githubusercontent.com/u/1251574?v=3","gravatar_id":"","url":"https://api.github.com/users/johnytex","html_url":"https://github.com/johnytex","followers_url":"https://api.github.com/users/johnytex/followers","following_url":"https://api.github.com/users/johnytex/following{/other_user}","gists_url":"https://api.github.com/users/johnytex/gists{/gist_id}","starred_url":"https://api.github.com/users/johnytex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnytex/subscriptions","organizations_url":"https://api.github.com/users/johnytex/orgs","repos_url":"https://api.github.com/users/johnytex/repos","events_url":"https://api.github.com/users/johnytex/events{/privacy}","received_events_url":"https://api.github.com/users/johnytex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-08T20:14:55Z","updated_at":"2015-04-08T20:27:39Z","closed_at":null,"body":"First of all, thanks for creating Marty! I'm new to the framework and development in React in general, and the experience has been very positive so far.\r\n\r\nThe other day I decided to add some unit tests to my application. Since I wanted to keep things simple I decided to use Mocha and run the tests from node initially.\r\n\r\nHowever, when I tried to use a Marty store I got a bunch of warnings about calling methods on a static instance - after coming across the [documentation on isomorphism](http://martyjs.org/guides/isomorphism/index.html) I realised this was because I was running on the server and the store was not initialised with a context.\r\n\r\nIf I understand correctly, this leaves me with these options:\r\n\r\n * Handle context in my stores, queries, action creators etc., e.g. adding `.for(this)` where appropriate.\r\n\r\n * Run my tests through Karma, meaning I would have to set it up and get it working with Browserify, PhantomJS, Babel and so on.\r\n\r\nIdeally I'd like to keep running tests on the server without having to add context handling everywhere. Is there a way to \"trick\" Marty into thinking it's running in a browser and short-circuit the concurrency handling, for example? \r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/jhollingworth/marty/issues/comments/91027728","html_url":"https://github.com/jhollingworth/marty/issues/270#issuecomment-91027728","issue_url":"https://api.github.com/repos/jhollingworth/marty/issues/270","id":91027728,"user":{"login":"johnytex","id":1251574,"avatar_url":"https://avatars.githubusercontent.com/u/1251574?v=3","gravatar_id":"","url":"https://api.github.com/users/johnytex","html_url":"https://github.com/johnytex","followers_url":"https://api.github.com/users/johnytex/followers","following_url":"https://api.github.com/users/johnytex/following{/other_user}","gists_url":"https://api.github.com/users/johnytex/gists{/gist_id}","starred_url":"https://api.github.com/users/johnytex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnytex/subscriptions","organizations_url":"https://api.github.com/users/johnytex/orgs","repos_url":"https://api.github.com/users/johnytex/repos","events_url":"https://api.github.com/users/johnytex/events{/privacy}","received_events_url":"https://api.github.com/users/johnytex/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T20:27:39Z","updated_at":"2015-04-08T20:27:39Z","body":"@oliverwoodings thanks! \r\n\r\nInitially I was thinking of using [jsdom](https://github.com/tmpvar/jsdom) for testing components, but maybe it's easier just to use Karma as you suggested."}}