{"action":"closed","issue":{"url":"https://api.github.com/repos/paypal/nemo-example-app/issues/10","labels_url":"https://api.github.com/repos/paypal/nemo-example-app/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/paypal/nemo-example-app/issues/10/comments","events_url":"https://api.github.com/repos/paypal/nemo-example-app/issues/10/events","html_url":"https://github.com/paypal/nemo-example-app/issues/10","id":87254633,"number":10,"title":"Async operations in mocha","user":{"login":"erikmueller","id":2292532,"avatar_url":"https://avatars.githubusercontent.com/u/2292532?v=3","gravatar_id":"","url":"https://api.github.com/users/erikmueller","html_url":"https://github.com/erikmueller","followers_url":"https://api.github.com/users/erikmueller/followers","following_url":"https://api.github.com/users/erikmueller/following{/other_user}","gists_url":"https://api.github.com/users/erikmueller/gists{/gist_id}","starred_url":"https://api.github.com/users/erikmueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikmueller/subscriptions","organizations_url":"https://api.github.com/users/erikmueller/orgs","repos_url":"https://api.github.com/users/erikmueller/repos","events_url":"https://api.github.com/users/erikmueller/events{/privacy}","received_events_url":"https://api.github.com/users/erikmueller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paypal/nemo-example-app/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-11T08:09:57Z","updated_at":"2015-07-01T19:20:35Z","closed_at":"2015-07-01T19:20:35Z","body":"I'm using nemo with mocha and it works pretty good so far. I was just wondering on what's the best approach to write a test. So here's what I think I understood so far (please correct if I'm wrong):\r\n\r\n1. All actions (e.g. `nemo.view.someView().click()`) return a promise\r\n2. Nevertheless all actions run synchronously and only the last must keep the test waiting\r\n\r\nIf both points are `true` then returning the last 'action' (which should be a promise) should do the trick and tell mocha it's an async test (see http://mochajs.org/#asynchronous-code last section).\r\n\r\nNow my question is: Does this suffice or should you do sth like:\r\n\r\n```js\r\nreturn nemo.driver.get(url)\r\n    .then(() => nemo.view.inputElement().click())\r\n    .then(() => nemo.view.nextInputElement().click())\r\n```\r\n\r\nwhich explicitly makes sure all promises are run in order.\r\n\r\nCheers and thanks for sharing Nemo "}}