{"action":"opened","issue":{"url":"https://api.github.com/repos/cypress-io/cypress/issues/2115","repository_url":"https://api.github.com/repos/cypress-io/cypress","labels_url":"https://api.github.com/repos/cypress-io/cypress/issues/2115/labels{/name}","comments_url":"https://api.github.com/repos/cypress-io/cypress/issues/2115/comments","events_url":"https://api.github.com/repos/cypress-io/cypress/issues/2115/events","html_url":"https://github.com/cypress-io/cypress/issues/2115","id":339826867,"node_id":"MDU6SXNzdWUzMzk4MjY4Njc=","number":2115,"title":"Crash if a \"describe\" block does not have a callback function","user":{"login":"bahmutov","id":2212006,"node_id":"MDQ6VXNlcjIyMTIwMDY=","avatar_url":"https://avatars1.githubusercontent.com/u/2212006?v=4","gravatar_id":"","url":"https://api.github.com/users/bahmutov","html_url":"https://github.com/bahmutov","followers_url":"https://api.github.com/users/bahmutov/followers","following_url":"https://api.github.com/users/bahmutov/following{/other_user}","gists_url":"https://api.github.com/users/bahmutov/gists{/gist_id}","starred_url":"https://api.github.com/users/bahmutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bahmutov/subscriptions","organizations_url":"https://api.github.com/users/bahmutov/orgs","repos_url":"https://api.github.com/users/bahmutov/repos","events_url":"https://api.github.com/users/bahmutov/events{/privacy}","received_events_url":"https://api.github.com/users/bahmutov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-10T12:47:48Z","updated_at":"2018-07-10T12:47:48Z","closed_at":null,"author_association":"COLLABORATOR","body":"- Cypress 3.0.1\r\n- Mac\r\n\r\nreproduction in https://github.com/cypress-io/cypress-test-tiny branch `empty-describe`\r\n- https://github.com/cypress-io/cypress-test-tiny/commit/63a6828b1e37a8895272fc36beaeaf7f986b49a9\r\n\r\nWhenever `describe` has just a function, or just a name (without a callback function) Cypress (probably Mocha engine inside) dies a violent death. Both these crash with `Uncaught TypeError: Cannot read property 'call' of undefined`\r\n\r\n```js\r\ndescribe(function page() {})\r\n\r\ndescribe('nope')\r\n```\r\n\r\n<img width=\"1279\" alt=\"screen shot 2018-07-10 at 2 43 07 pm\" src=\"https://user-images.githubusercontent.com/2212006/42510656-e82b90a2-844f-11e8-9817-c803b8d557da.png\">\r\n\r\nCode at crash site\r\n\r\n```js\r\ncontext.describe = context.context = function(title, fn) {\r\n  var suite = Suite.create(suites[0], title);\r\n  suite.file = file;\r\n  suites.unshift(suite);\r\n  fn.call(suite);\r\n  suites.shift();\r\n  return suite;\r\n};\r\n```\r\n\r\nNote that tests without a callback function are fine, they are just pending, so `it('works')` has no problems.\r\n"}}
{"actor":{"display_login":"bahmutov"}}