{"action":"created","comment":{"url":"https://api.github.com/repos/jquery/qunit/pulls/comments/63304934","id":63304934,"diff_hunk":"@@ -24,6 +24,21 @@ QUnit.test( \"basics\", function( assert ) {\n \t);\n } );\n \n+QUnit.test( \"setup for null reset\", function( assert ) {\n+\tassert.expect( 0 );\n+\tQUnit.config.fixture = null;\n+\tdocument.getElementById( \"qunit-fixture\" ).innerHTML = \"foobar\";\n+} );\n+\n+QUnit.test( \"basics for null reset\", function( assert ) {\n+\tassert.equal(\n+\t\tdocument.getElementById( \"qunit-fixture\" ).innerHTML,\n+\t\t\"foobar\",\n+\t\t\"did not reset after last test\"\n+\t);\n+\tQUnit.config.fixture = \"test markup\";","path":"test/main/test.js","position":16,"original_position":16,"commit_id":"2401d538db7c05ae44880e01cceab174754af83c","original_commit_id":"2401d538db7c05ae44880e01cceab174754af83c","user":{"login":"gibson042","id":1199584,"avatar_url":"https://avatars.githubusercontent.com/u/1199584?v=3","gravatar_id":"","url":"https://api.github.com/users/gibson042","html_url":"https://github.com/gibson042","followers_url":"https://api.github.com/users/gibson042/followers","following_url":"https://api.github.com/users/gibson042/following{/other_user}","gists_url":"https://api.github.com/users/gibson042/gists{/gist_id}","starred_url":"https://api.github.com/users/gibson042/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibson042/subscriptions","organizations_url":"https://api.github.com/users/gibson042/orgs","repos_url":"https://api.github.com/users/gibson042/repos","events_url":"https://api.github.com/users/gibson042/events{/privacy}","received_events_url":"https://api.github.com/users/gibson042/received_events","type":"User","site_admin":false},"body":"This is missing tests for `QUnit.config.fixture = userSpecifiedContent`, and is also a bit ugly (admittedly a preexisting condition). Could we use beforeEach/afterEach to make it more robust and (arguably) a little cleaner?\r\n```js\r\nQUnit.module( \"fixture\", function( hooks ) {\r\n\tvar failure = false,\r\n\t\tvalues = [ /* initial value (see unshift below), */ \"<b>ar</b>\", undefined ],\r\n\r\n\t\t// Use values as a \"not-set\" sentinel\r\n\t\toriginalValue = values;\r\n\thooks.beforeEach( function() {\r\n\t\tif ( originalValue === values ) {\r\n\t\t\toriginalValue = QUnit.config.fixture;\r\n\t\t\tvalues.unshift( originalValue );\r\n\t\t}\r\n\t} );\r\n\r\n\t// Set QUnit.config.fixture for the next test, propagating failures to recover the sequence\r\n\thooks.afterEach( function( assert ) {\r\n\t\tif ( failure || values.length === 0 ) {\r\n\t\t\tassert.ok( false, \"prior failure\" );\r\n\t\t\tQUnit.config.fixture = originalValue;\r\n\t\t} else {\r\n\t\t\tQUnit.config.fixture = values.shift();\r\n\t\t}\r\n\t} );\r\n\r\n\tQUnit.test( \"setup\", function( assert ) {\r\n\t\tdocument.getElementById( \"qunit-fixture\" ).innerHTML = \"foo\";\r\n\t\tassert.equal( values.length, 3, \"proper sequence\" );\r\n\t\tfailure = failure || values.length !== 3;\r\n\t} );\r\n\tQUnit.test( \"automatically reset\", function( assert ) {\r\n\t\tvar contents = document.getElementById( \"qunit-fixture\" ).innerHTML;\r\n\t\tassert.equal( contents, \"test markup\" );\r\n\t\tassert.equal( values.length, 2, \"proper sequence\" );\r\n\t\tfailure = failure || values.length !== 2 || contents !== \"test markup\";\r\n\t} );\r\n\tQUnit.test( \"user-specified\", function( assert ) {\r\n\t\tvar contents = document.getElementById( \"qunit-fixture\" ).innerHTML;\r\n\t\tdocument.getElementById( \"qunit-fixture\" ).innerHTML = \"baz\";\r\n\t\tassert.equal( contents, \"<b>ar</b>\" );\r\n\t\tassert.equal( values.length, 1, \"proper sequence\" );\r\n\t\tfailure = failure || values.length !== 1 || contents !== \"<b>ar</b>\";\r\n\t} );\r\n\tQUnit.test( \"disabled\", function( assert ) {\r\n\t\tvar contents = document.getElementById( \"qunit-fixture\" ).innerHTML;\r\n\t\tassert.equal( contents, \"baz\" );\r\n\t\tassert.equal( values.length, 0, \"proper sequence\" );\r\n\t\tfailure = failure || values.length !== 0 || contents !== \"baz\";\r\n\t} );\r\n} );\r\n```","created_at":"2016-05-16T02:32:15Z","updated_at":"2016-05-16T02:32:15Z","html_url":"https://github.com/jquery/qunit/pull/998#discussion_r63304934","pull_request_url":"https://api.github.com/repos/jquery/qunit/pulls/998","_links":{"self":{"href":"https://api.github.com/repos/jquery/qunit/pulls/comments/63304934"},"html":{"href":"https://github.com/jquery/qunit/pull/998#discussion_r63304934"},"pull_request":{"href":"https://api.github.com/repos/jquery/qunit/pulls/998"}}},"pull_request":{"url":"https://api.github.com/repos/jquery/qunit/pulls/998","id":70104834,"html_url":"https://github.com/jquery/qunit/pull/998","diff_url":"https://github.com/jquery/qunit/pull/998.diff","patch_url":"https://github.com/jquery/qunit/pull/998.patch","issue_url":"https://api.github.com/repos/jquery/qunit/issues/998","number":998,"state":"open","locked":false,"title":"All: Decouple Core fixture reset from HTML reporter","user":{"login":"trentmwillis","id":3526753,"avatar_url":"https://avatars.githubusercontent.com/u/3526753?v=3","gravatar_id":"","url":"https://api.github.com/users/trentmwillis","html_url":"https://github.com/trentmwillis","followers_url":"https://api.github.com/users/trentmwillis/followers","following_url":"https://api.github.com/users/trentmwillis/following{/other_user}","gists_url":"https://api.github.com/users/trentmwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/trentmwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentmwillis/subscriptions","organizations_url":"https://api.github.com/users/trentmwillis/orgs","repos_url":"https://api.github.com/users/trentmwillis/repos","events_url":"https://api.github.com/users/trentmwillis/events{/privacy}","received_events_url":"https://api.github.com/users/trentmwillis/received_events","type":"User","site_admin":false},"body":"Addresses #974. Will have a corresponding PR for documenting `QUnit.config.fixture`.","created_at":"2016-05-14T21:45:34Z","updated_at":"2016-05-16T02:32:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"450343b822cc411131d4da554002c58d62a595b5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jquery/qunit/pulls/998/commits","review_comments_url":"https://api.github.com/repos/jquery/qunit/pulls/998/comments","review_comment_url":"https://api.github.com/repos/jquery/qunit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jquery/qunit/issues/998/comments","statuses_url":"https://api.github.com/repos/jquery/qunit/statuses/2401d538db7c05ae44880e01cceab174754af83c","head":{"label":"trentmwillis:reset","ref":"reset","sha":"2401d538db7c05ae44880e01cceab174754af83c","user":{"login":"trentmwillis","id":3526753,"avatar_url":"https://avatars.githubusercontent.com/u/3526753?v=3","gravatar_id":"","url":"https://api.github.com/users/trentmwillis","html_url":"https://github.com/trentmwillis","followers_url":"https://api.github.com/users/trentmwillis/followers","following_url":"https://api.github.com/users/trentmwillis/following{/other_user}","gists_url":"https://api.github.com/users/trentmwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/trentmwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentmwillis/subscriptions","organizations_url":"https://api.github.com/users/trentmwillis/orgs","repos_url":"https://api.github.com/users/trentmwillis/repos","events_url":"https://api.github.com/users/trentmwillis/events{/privacy}","received_events_url":"https://api.github.com/users/trentmwillis/received_events","type":"User","site_admin":false},"repo":{"id":48075616,"name":"qunit","full_name":"trentmwillis/qunit","owner":{"login":"trentmwillis","id":3526753,"avatar_url":"https://avatars.githubusercontent.com/u/3526753?v=3","gravatar_id":"","url":"https://api.github.com/users/trentmwillis","html_url":"https://github.com/trentmwillis","followers_url":"https://api.github.com/users/trentmwillis/followers","following_url":"https://api.github.com/users/trentmwillis/following{/other_user}","gists_url":"https://api.github.com/users/trentmwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/trentmwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentmwillis/subscriptions","organizations_url":"https://api.github.com/users/trentmwillis/orgs","repos_url":"https://api.github.com/users/trentmwillis/repos","events_url":"https://api.github.com/users/trentmwillis/events{/privacy}","received_events_url":"https://api.github.com/users/trentmwillis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trentmwillis/qunit","description":"An easy-to-use JavaScript Unit Testing framework.","fork":true,"url":"https://api.github.com/repos/trentmwillis/qunit","forks_url":"https://api.github.com/repos/trentmwillis/qunit/forks","keys_url":"https://api.github.com/repos/trentmwillis/qunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trentmwillis/qunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trentmwillis/qunit/teams","hooks_url":"https://api.github.com/repos/trentmwillis/qunit/hooks","issue_events_url":"https://api.github.com/repos/trentmwillis/qunit/issues/events{/number}","events_url":"https://api.github.com/repos/trentmwillis/qunit/events","assignees_url":"https://api.github.com/repos/trentmwillis/qunit/assignees{/user}","branches_url":"https://api.github.com/repos/trentmwillis/qunit/branches{/branch}","tags_url":"https://api.github.com/repos/trentmwillis/qunit/tags","blobs_url":"https://api.github.com/repos/trentmwillis/qunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trentmwillis/qunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trentmwillis/qunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/trentmwillis/qunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trentmwillis/qunit/statuses/{sha}","languages_url":"https://api.github.com/repos/trentmwillis/qunit/languages","stargazers_url":"https://api.github.com/repos/trentmwillis/qunit/stargazers","contributors_url":"https://api.github.com/repos/trentmwillis/qunit/contributors","subscribers_url":"https://api.github.com/repos/trentmwillis/qunit/subscribers","subscription_url":"https://api.github.com/repos/trentmwillis/qunit/subscription","commits_url":"https://api.github.com/repos/trentmwillis/qunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/trentmwillis/qunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/trentmwillis/qunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/trentmwillis/qunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/trentmwillis/qunit/contents/{+path}","compare_url":"https://api.github.com/repos/trentmwillis/qunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trentmwillis/qunit/merges","archive_url":"https://api.github.com/repos/trentmwillis/qunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trentmwillis/qunit/downloads","issues_url":"https://api.github.com/repos/trentmwillis/qunit/issues{/number}","pulls_url":"https://api.github.com/repos/trentmwillis/qunit/pulls{/number}","milestones_url":"https://api.github.com/repos/trentmwillis/qunit/milestones{/number}","notifications_url":"https://api.github.com/repos/trentmwillis/qunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trentmwillis/qunit/labels{/name}","releases_url":"https://api.github.com/repos/trentmwillis/qunit/releases{/id}","deployments_url":"https://api.github.com/repos/trentmwillis/qunit/deployments","created_at":"2015-12-15T23:48:01Z","updated_at":"2016-01-12T05:11:14Z","pushed_at":"2016-05-15T00:05:20Z","git_url":"git://github.com/trentmwillis/qunit.git","ssh_url":"git@github.com:trentmwillis/qunit.git","clone_url":"https://github.com/trentmwillis/qunit.git","svn_url":"https://github.com/trentmwillis/qunit","homepage":"http://qunitjs.com","size":1537,"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":"jquery:master","ref":"master","sha":"1a9a639e26d9e836a4e48e352d8004c0b9fa27fe","user":{"login":"jquery","id":70142,"avatar_url":"https://avatars.githubusercontent.com/u/70142?v=3","gravatar_id":"","url":"https://api.github.com/users/jquery","html_url":"https://github.com/jquery","followers_url":"https://api.github.com/users/jquery/followers","following_url":"https://api.github.com/users/jquery/following{/other_user}","gists_url":"https://api.github.com/users/jquery/gists{/gist_id}","starred_url":"https://api.github.com/users/jquery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquery/subscriptions","organizations_url":"https://api.github.com/users/jquery/orgs","repos_url":"https://api.github.com/users/jquery/repos","events_url":"https://api.github.com/users/jquery/events{/privacy}","received_events_url":"https://api.github.com/users/jquery/received_events","type":"Organization","site_admin":false},"repo":{"id":259691,"name":"qunit","full_name":"jquery/qunit","owner":{"login":"jquery","id":70142,"avatar_url":"https://avatars.githubusercontent.com/u/70142?v=3","gravatar_id":"","url":"https://api.github.com/users/jquery","html_url":"https://github.com/jquery","followers_url":"https://api.github.com/users/jquery/followers","following_url":"https://api.github.com/users/jquery/following{/other_user}","gists_url":"https://api.github.com/users/jquery/gists{/gist_id}","starred_url":"https://api.github.com/users/jquery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jquery/subscriptions","organizations_url":"https://api.github.com/users/jquery/orgs","repos_url":"https://api.github.com/users/jquery/repos","events_url":"https://api.github.com/users/jquery/events{/privacy}","received_events_url":"https://api.github.com/users/jquery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jquery/qunit","description":"An easy-to-use JavaScript Unit Testing framework.","fork":false,"url":"https://api.github.com/repos/jquery/qunit","forks_url":"https://api.github.com/repos/jquery/qunit/forks","keys_url":"https://api.github.com/repos/jquery/qunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jquery/qunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jquery/qunit/teams","hooks_url":"https://api.github.com/repos/jquery/qunit/hooks","issue_events_url":"https://api.github.com/repos/jquery/qunit/issues/events{/number}","events_url":"https://api.github.com/repos/jquery/qunit/events","assignees_url":"https://api.github.com/repos/jquery/qunit/assignees{/user}","branches_url":"https://api.github.com/repos/jquery/qunit/branches{/branch}","tags_url":"https://api.github.com/repos/jquery/qunit/tags","blobs_url":"https://api.github.com/repos/jquery/qunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jquery/qunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jquery/qunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/jquery/qunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jquery/qunit/statuses/{sha}","languages_url":"https://api.github.com/repos/jquery/qunit/languages","stargazers_url":"https://api.github.com/repos/jquery/qunit/stargazers","contributors_url":"https://api.github.com/repos/jquery/qunit/contributors","subscribers_url":"https://api.github.com/repos/jquery/qunit/subscribers","subscription_url":"https://api.github.com/repos/jquery/qunit/subscription","commits_url":"https://api.github.com/repos/jquery/qunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/jquery/qunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/jquery/qunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/jquery/qunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/jquery/qunit/contents/{+path}","compare_url":"https://api.github.com/repos/jquery/qunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jquery/qunit/merges","archive_url":"https://api.github.com/repos/jquery/qunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jquery/qunit/downloads","issues_url":"https://api.github.com/repos/jquery/qunit/issues{/number}","pulls_url":"https://api.github.com/repos/jquery/qunit/pulls{/number}","milestones_url":"https://api.github.com/repos/jquery/qunit/milestones{/number}","notifications_url":"https://api.github.com/repos/jquery/qunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jquery/qunit/labels{/name}","releases_url":"https://api.github.com/repos/jquery/qunit/releases{/id}","deployments_url":"https://api.github.com/repos/jquery/qunit/deployments","created_at":"2009-07-24T16:26:23Z","updated_at":"2016-05-14T05:20:26Z","pushed_at":"2016-05-15T00:05:36Z","git_url":"git://github.com/jquery/qunit.git","ssh_url":"git@github.com:jquery/qunit.git","clone_url":"https://github.com/jquery/qunit.git","svn_url":"https://github.com/jquery/qunit","homepage":"http://qunitjs.com","size":6083,"stargazers_count":3434,"watchers_count":3434,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":714,"mirror_url":null,"open_issues_count":48,"forks":714,"open_issues":48,"watchers":3434,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jquery/qunit/pulls/998"},"html":{"href":"https://github.com/jquery/qunit/pull/998"},"issue":{"href":"https://api.github.com/repos/jquery/qunit/issues/998"},"comments":{"href":"https://api.github.com/repos/jquery/qunit/issues/998/comments"},"review_comments":{"href":"https://api.github.com/repos/jquery/qunit/pulls/998/comments"},"review_comment":{"href":"https://api.github.com/repos/jquery/qunit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jquery/qunit/pulls/998/commits"},"statuses":{"href":"https://api.github.com/repos/jquery/qunit/statuses/2401d538db7c05ae44880e01cceab174754af83c"}}}}