{"action":"opened","issue":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/622","repository_url":"https://api.github.com/repos/cucumber/cucumber-js","labels_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/622/labels{/name}","comments_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/622/comments","events_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/622/events","html_url":"https://github.com/cucumber/cucumber-js/issues/622","id":170047846,"number":622,"title":"Add support for Cucumber Expressions","user":{"login":"aslakhellesoy","id":1000,"avatar_url":"https://avatars.githubusercontent.com/u/1000?v=3","gravatar_id":"","url":"https://api.github.com/users/aslakhellesoy","html_url":"https://github.com/aslakhellesoy","followers_url":"https://api.github.com/users/aslakhellesoy/followers","following_url":"https://api.github.com/users/aslakhellesoy/following{/other_user}","gists_url":"https://api.github.com/users/aslakhellesoy/gists{/gist_id}","starred_url":"https://api.github.com/users/aslakhellesoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aslakhellesoy/subscriptions","organizations_url":"https://api.github.com/users/aslakhellesoy/orgs","repos_url":"https://api.github.com/users/aslakhellesoy/repos","events_url":"https://api.github.com/users/aslakhellesoy/events{/privacy}","received_events_url":"https://api.github.com/users/aslakhellesoy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-08T23:16:40Z","updated_at":"2016-08-08T23:16:40Z","closed_at":null,"body":"## Summary\r\n\r\n[Cucumber Expressions](http://docs.cucumber.io/cucumber-expressions/) is a new alternative to\r\nRegular Expressions, which is easier to read and write, and less daunting.\r\n\r\n## Expected Behavior\r\n\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\n<!--- Feel free to use Given / Then / Then if that helps, but please add some plain-language context too -->\r\n\r\nStep Defintions defined with a `String` (and not a `Regexp`) should be interpreted as a Cucumber Expression:\r\n\r\n```JavaScript\r\nGiven(\"I have {n:int} cukes in my belly\", function(cukeCount) {\r\n  // It's already converted to a number\r\n  asser.equal(typeof cukeCount, 'number')\r\n})\r\n```\r\n\r\nLikewise, if a Regular Expression is used (old school):\r\n\r\n```javascript\r\nGiven(/I have (\\d+) cukes in my belly/, function(cukeCount) {\r\n  // It's already converted to a number\r\n  asser.equal(typeof cukeCount, 'number')\r\n})\r\n```\r\n\r\nThis is possible because the `cucumber-expression` library's `RegExp` support takes advantage of type conversions too.\r\n\r\nSnippets for undefined steps should use Cucumber Expressions, and not Regular Expressions. We want users to start migrating, and if we can avoid it we'll not generate snippets with regular expressions. (Well, we might if enough people want it). The `cucumber-expression` library can already generate expressions from text.\r\n\r\nFinally, the current `Transform` logic should be deprecated and the logic built into the `cucumber-expression` library should be used instead.\r\n\r\n## Context & Motivation\r\n\r\nHaving to use Regular Expressions is one of the most common complaints against Cucumber. Other clones of Cucumber who support something similar to Cucumber Expressions seem to have happier users!\r\n"}}
{"actor":{"display_login":"aslakhellesoy"}}