{"action":"created","comment":{"url":"https://api.github.com/repos/cucumber/cucumber-js/pulls/comments/61732001","id":61732001,"diff_hunk":"@@ -0,0 +1,129 @@\n+Feature: Fake Time\n+  Background:\n+    Given a file named \"features/support/hooks.js\" with:\n+    \"\"\"\n+    var sinon = require('sinon');\n+    var hooks = function () {\n+\n+      this.Before({tags: ['@fakedTime']}, function(scenario, callback) {\n+        this.clock = sinon.useFakeTimers();\n+        callback();\n+      });\n+\n+      this.After({tags: ['@fakedTime']}, function(scenario, callback) {\n+        this.clock.restore();\n+        callback();\n+      });\n+\n+    };\n+\n+    module.exports = hooks;\n+    \"\"\"\n+\n+  Scenario: Use fake timers to faked time\n+    Given a file named \"features/passing_steps.feature\" with:\n+      \"\"\"\n+      Feature: a feature\n+        @fakedTime\n+        Scenario: a scenario\n+          Given a faked time step\n+      \"\"\"\n+\n+    Given a file named \"features/step_definitions/passing_steps.js\" with:\n+      \"\"\"\n+      var assert = require('assert');\n+      var sinon = require('sinon')\n+\n+      stepDefinitions = function() {\n+        this.Given(/^a faked time step$/, function (done) {\n+          var testFunction = sinon.stub();\n+          setTimeout(testFunction, 100);\n+          assert(!testFunction.called);\n+          this.clock.tick(101);\n+          assert(testFunction.called);\n+          done()\n+        });\n+      };\n+\n+      module.exports = stepDefinitions\n+      \"\"\"\n+\n+      When I run cucumber.js with `--strict`\n+      Then it passes\n+\n+\n+  Scenario: faked time doesn't trigger the test runner timeout\n+\n+    Given a file named \"features/passing_steps.feature\" with:\n+      \"\"\"\n+      Feature: a feature\n+        @fakedTime\n+        Scenario: a scenario\n+          Given a faked time step\n+      \"\"\"\n+\n+    Given a file named \"features/step_definitions/passing_steps.js\" with:\n+      \"\"\"\n+      var assert = require('assert');\n+      var sinon = require('sinon')\n+\n+      stepDefinitions = function() {\n+        this.Given(/^a faked time step$/, function (done) {\n+          var testFunction = sinon.stub();\n+          setTimeout(testFunction, 10000);\n+          assert(!testFunction.called);\n+          this.clock.tick(10001);\n+          assert(testFunction.called);\n+          done()\n+        });\n+      };\n+\n+      module.exports = stepDefinitions\n+      \"\"\"\n+      When I run cucumber.js with `--strict`\n+      Then it passes\n+\n+\n+  Scenario: real time is restored","path":"features/fake_time.feature","position":87,"original_position":87,"commit_id":"3f8ef05eecdbcfb5d1a26cc9a3604c2dc26e4015","original_commit_id":"3f8ef05eecdbcfb5d1a26cc9a3604c2dc26e4015","user":{"login":"charlierudolph","id":1676758,"avatar_url":"https://avatars.githubusercontent.com/u/1676758?v=3","gravatar_id":"","url":"https://api.github.com/users/charlierudolph","html_url":"https://github.com/charlierudolph","followers_url":"https://api.github.com/users/charlierudolph/followers","following_url":"https://api.github.com/users/charlierudolph/following{/other_user}","gists_url":"https://api.github.com/users/charlierudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/charlierudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlierudolph/subscriptions","organizations_url":"https://api.github.com/users/charlierudolph/orgs","repos_url":"https://api.github.com/users/charlierudolph/repos","events_url":"https://api.github.com/users/charlierudolph/events{/privacy}","received_events_url":"https://api.github.com/users/charlierudolph/received_events","type":"User","site_admin":false},"body":"I'm not certain this is test is really needed. The name makes me think that real time was mocked but it never was.","created_at":"2016-05-02T12:22:16Z","updated_at":"2016-05-02T12:22:16Z","html_url":"https://github.com/cucumber/cucumber-js/pull/562#discussion_r61732001","pull_request_url":"https://api.github.com/repos/cucumber/cucumber-js/pulls/562","_links":{"self":{"href":"https://api.github.com/repos/cucumber/cucumber-js/pulls/comments/61732001"},"html":{"href":"https://github.com/cucumber/cucumber-js/pull/562#discussion_r61732001"},"pull_request":{"href":"https://api.github.com/repos/cucumber/cucumber-js/pulls/562"}}},"pull_request":{"url":"https://api.github.com/repos/cucumber/cucumber-js/pulls/562","id":67656175,"html_url":"https://github.com/cucumber/cucumber-js/pull/562","diff_url":"https://github.com/cucumber/cucumber-js/pull/562.diff","patch_url":"https://github.com/cucumber/cucumber-js/pull/562.patch","issue_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/562","number":562,"state":"open","locked":false,"title":"fix timeout to allow fake timers","user":{"login":"mjhm","id":431925,"avatar_url":"https://avatars.githubusercontent.com/u/431925?v=3","gravatar_id":"","url":"https://api.github.com/users/mjhm","html_url":"https://github.com/mjhm","followers_url":"https://api.github.com/users/mjhm/followers","following_url":"https://api.github.com/users/mjhm/following{/other_user}","gists_url":"https://api.github.com/users/mjhm/gists{/gist_id}","starred_url":"https://api.github.com/users/mjhm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjhm/subscriptions","organizations_url":"https://api.github.com/users/mjhm/orgs","repos_url":"https://api.github.com/users/mjhm/repos","events_url":"https://api.github.com/users/mjhm/events{/privacy}","received_events_url":"https://api.github.com/users/mjhm/received_events","type":"User","site_admin":false},"body":"@charlierudolph This is the fix to allow `sinon.useFakeTimers` or similar time mocking to work. https://github.com/cucumber/cucumber-js/issues/535\r\n\r\nI'm not sure exactly where to plug in new tests for it though.\r\n\r\nI have my own example test repo at https://github.com/mjhm/cucumber-test which demonstrates the problem using 0.10.2 vs this update.","created_at":"2016-04-25T01:01:35Z","updated_at":"2016-05-02T12:22:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a275daa3840ffa792a69ce4cfbc68d9b7cc1420a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cucumber/cucumber-js/pulls/562/commits","review_comments_url":"https://api.github.com/repos/cucumber/cucumber-js/pulls/562/comments","review_comment_url":"https://api.github.com/repos/cucumber/cucumber-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/562/comments","statuses_url":"https://api.github.com/repos/cucumber/cucumber-js/statuses/3f8ef05eecdbcfb5d1a26cc9a3604c2dc26e4015","head":{"label":"mjhm:jm-real-time","ref":"jm-real-time","sha":"3f8ef05eecdbcfb5d1a26cc9a3604c2dc26e4015","user":{"login":"mjhm","id":431925,"avatar_url":"https://avatars.githubusercontent.com/u/431925?v=3","gravatar_id":"","url":"https://api.github.com/users/mjhm","html_url":"https://github.com/mjhm","followers_url":"https://api.github.com/users/mjhm/followers","following_url":"https://api.github.com/users/mjhm/following{/other_user}","gists_url":"https://api.github.com/users/mjhm/gists{/gist_id}","starred_url":"https://api.github.com/users/mjhm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjhm/subscriptions","organizations_url":"https://api.github.com/users/mjhm/orgs","repos_url":"https://api.github.com/users/mjhm/repos","events_url":"https://api.github.com/users/mjhm/events{/privacy}","received_events_url":"https://api.github.com/users/mjhm/received_events","type":"User","site_admin":false},"repo":{"id":56999903,"name":"cucumber-js","full_name":"mjhm/cucumber-js","owner":{"login":"mjhm","id":431925,"avatar_url":"https://avatars.githubusercontent.com/u/431925?v=3","gravatar_id":"","url":"https://api.github.com/users/mjhm","html_url":"https://github.com/mjhm","followers_url":"https://api.github.com/users/mjhm/followers","following_url":"https://api.github.com/users/mjhm/following{/other_user}","gists_url":"https://api.github.com/users/mjhm/gists{/gist_id}","starred_url":"https://api.github.com/users/mjhm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjhm/subscriptions","organizations_url":"https://api.github.com/users/mjhm/orgs","repos_url":"https://api.github.com/users/mjhm/repos","events_url":"https://api.github.com/users/mjhm/events{/privacy}","received_events_url":"https://api.github.com/users/mjhm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjhm/cucumber-js","description":"Cucumber for JavaScript","fork":true,"url":"https://api.github.com/repos/mjhm/cucumber-js","forks_url":"https://api.github.com/repos/mjhm/cucumber-js/forks","keys_url":"https://api.github.com/repos/mjhm/cucumber-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjhm/cucumber-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjhm/cucumber-js/teams","hooks_url":"https://api.github.com/repos/mjhm/cucumber-js/hooks","issue_events_url":"https://api.github.com/repos/mjhm/cucumber-js/issues/events{/number}","events_url":"https://api.github.com/repos/mjhm/cucumber-js/events","assignees_url":"https://api.github.com/repos/mjhm/cucumber-js/assignees{/user}","branches_url":"https://api.github.com/repos/mjhm/cucumber-js/branches{/branch}","tags_url":"https://api.github.com/repos/mjhm/cucumber-js/tags","blobs_url":"https://api.github.com/repos/mjhm/cucumber-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjhm/cucumber-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjhm/cucumber-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjhm/cucumber-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjhm/cucumber-js/statuses/{sha}","languages_url":"https://api.github.com/repos/mjhm/cucumber-js/languages","stargazers_url":"https://api.github.com/repos/mjhm/cucumber-js/stargazers","contributors_url":"https://api.github.com/repos/mjhm/cucumber-js/contributors","subscribers_url":"https://api.github.com/repos/mjhm/cucumber-js/subscribers","subscription_url":"https://api.github.com/repos/mjhm/cucumber-js/subscription","commits_url":"https://api.github.com/repos/mjhm/cucumber-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjhm/cucumber-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjhm/cucumber-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjhm/cucumber-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjhm/cucumber-js/contents/{+path}","compare_url":"https://api.github.com/repos/mjhm/cucumber-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjhm/cucumber-js/merges","archive_url":"https://api.github.com/repos/mjhm/cucumber-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjhm/cucumber-js/downloads","issues_url":"https://api.github.com/repos/mjhm/cucumber-js/issues{/number}","pulls_url":"https://api.github.com/repos/mjhm/cucumber-js/pulls{/number}","milestones_url":"https://api.github.com/repos/mjhm/cucumber-js/milestones{/number}","notifications_url":"https://api.github.com/repos/mjhm/cucumber-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjhm/cucumber-js/labels{/name}","releases_url":"https://api.github.com/repos/mjhm/cucumber-js/releases{/id}","deployments_url":"https://api.github.com/repos/mjhm/cucumber-js/deployments","created_at":"2016-04-24T23:57:16Z","updated_at":"2016-04-24T23:57:18Z","pushed_at":"2016-04-30T17:59:01Z","git_url":"git://github.com/mjhm/cucumber-js.git","ssh_url":"git@github.com:mjhm/cucumber-js.git","clone_url":"https://github.com/mjhm/cucumber-js.git","svn_url":"https://github.com/mjhm/cucumber-js","homepage":"https://cucumber.io/docs/reference/javascript","size":11523,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cucumber:master","ref":"master","sha":"6b8f4bb83d0c4948b030dcdde57f92ec7f73c3d3","user":{"login":"cucumber","id":320565,"avatar_url":"https://avatars.githubusercontent.com/u/320565?v=3","gravatar_id":"","url":"https://api.github.com/users/cucumber","html_url":"https://github.com/cucumber","followers_url":"https://api.github.com/users/cucumber/followers","following_url":"https://api.github.com/users/cucumber/following{/other_user}","gists_url":"https://api.github.com/users/cucumber/gists{/gist_id}","starred_url":"https://api.github.com/users/cucumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cucumber/subscriptions","organizations_url":"https://api.github.com/users/cucumber/orgs","repos_url":"https://api.github.com/users/cucumber/repos","events_url":"https://api.github.com/users/cucumber/events{/privacy}","received_events_url":"https://api.github.com/users/cucumber/received_events","type":"Organization","site_admin":false},"repo":{"id":1811965,"name":"cucumber-js","full_name":"cucumber/cucumber-js","owner":{"login":"cucumber","id":320565,"avatar_url":"https://avatars.githubusercontent.com/u/320565?v=3","gravatar_id":"","url":"https://api.github.com/users/cucumber","html_url":"https://github.com/cucumber","followers_url":"https://api.github.com/users/cucumber/followers","following_url":"https://api.github.com/users/cucumber/following{/other_user}","gists_url":"https://api.github.com/users/cucumber/gists{/gist_id}","starred_url":"https://api.github.com/users/cucumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cucumber/subscriptions","organizations_url":"https://api.github.com/users/cucumber/orgs","repos_url":"https://api.github.com/users/cucumber/repos","events_url":"https://api.github.com/users/cucumber/events{/privacy}","received_events_url":"https://api.github.com/users/cucumber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cucumber/cucumber-js","description":"Cucumber for JavaScript","fork":false,"url":"https://api.github.com/repos/cucumber/cucumber-js","forks_url":"https://api.github.com/repos/cucumber/cucumber-js/forks","keys_url":"https://api.github.com/repos/cucumber/cucumber-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cucumber/cucumber-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cucumber/cucumber-js/teams","hooks_url":"https://api.github.com/repos/cucumber/cucumber-js/hooks","issue_events_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/events{/number}","events_url":"https://api.github.com/repos/cucumber/cucumber-js/events","assignees_url":"https://api.github.com/repos/cucumber/cucumber-js/assignees{/user}","branches_url":"https://api.github.com/repos/cucumber/cucumber-js/branches{/branch}","tags_url":"https://api.github.com/repos/cucumber/cucumber-js/tags","blobs_url":"https://api.github.com/repos/cucumber/cucumber-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cucumber/cucumber-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cucumber/cucumber-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/cucumber/cucumber-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cucumber/cucumber-js/statuses/{sha}","languages_url":"https://api.github.com/repos/cucumber/cucumber-js/languages","stargazers_url":"https://api.github.com/repos/cucumber/cucumber-js/stargazers","contributors_url":"https://api.github.com/repos/cucumber/cucumber-js/contributors","subscribers_url":"https://api.github.com/repos/cucumber/cucumber-js/subscribers","subscription_url":"https://api.github.com/repos/cucumber/cucumber-js/subscription","commits_url":"https://api.github.com/repos/cucumber/cucumber-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/cucumber/cucumber-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/cucumber/cucumber-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/cucumber/cucumber-js/contents/{+path}","compare_url":"https://api.github.com/repos/cucumber/cucumber-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cucumber/cucumber-js/merges","archive_url":"https://api.github.com/repos/cucumber/cucumber-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cucumber/cucumber-js/downloads","issues_url":"https://api.github.com/repos/cucumber/cucumber-js/issues{/number}","pulls_url":"https://api.github.com/repos/cucumber/cucumber-js/pulls{/number}","milestones_url":"https://api.github.com/repos/cucumber/cucumber-js/milestones{/number}","notifications_url":"https://api.github.com/repos/cucumber/cucumber-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cucumber/cucumber-js/labels{/name}","releases_url":"https://api.github.com/repos/cucumber/cucumber-js/releases{/id}","deployments_url":"https://api.github.com/repos/cucumber/cucumber-js/deployments","created_at":"2011-05-27T21:27:17Z","updated_at":"2016-05-01T18:55:09Z","pushed_at":"2016-04-30T23:52:08Z","git_url":"git://github.com/cucumber/cucumber-js.git","ssh_url":"git@github.com:cucumber/cucumber-js.git","clone_url":"https://github.com/cucumber/cucumber-js.git","svn_url":"https://github.com/cucumber/cucumber-js","homepage":"https://cucumber.io/docs/reference/javascript","size":15120,"stargazers_count":2011,"watchers_count":2011,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":341,"mirror_url":null,"open_issues_count":52,"forks":341,"open_issues":52,"watchers":2011,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cucumber/cucumber-js/pulls/562"},"html":{"href":"https://github.com/cucumber/cucumber-js/pull/562"},"issue":{"href":"https://api.github.com/repos/cucumber/cucumber-js/issues/562"},"comments":{"href":"https://api.github.com/repos/cucumber/cucumber-js/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/cucumber/cucumber-js/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/cucumber/cucumber-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cucumber/cucumber-js/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/cucumber/cucumber-js/statuses/3f8ef05eecdbcfb5d1a26cc9a3604c2dc26e4015"}}}}