{"action":"created","comment":{"url":"https://api.github.com/repos/metarhia/metatests/pulls/comments/211359037","pull_request_review_id":147762021,"id":211359037,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTM1OTAzNw==","diff_hunk":"@@ -2,59 +2,66 @@\n \n const common = require('metarhia-common');\n \n-module.exports = (metatests) => {\n-\n-  metatests.case = (\n-    caption, // Case caption\n-    list // hash of Array\n-    // Hint: hash keys are function and method names\n-    // Array contains call parameters\n-    // last Array item is an expected result (to compare)\n-    // or function (pass result to compare)\n-  ) => {\n-    metatests.results.modules++;\n-\n-    let conditions, target, targetType, targetValue, definition, msg, cmp,\n-        parameters, sParameters, expected, sExpected, expectedType,\n-        result, sResult, functionPath, className, methodName, functionName;\n-\n-    const classes = [];\n-\n-    for (functionName in list) {\n-      conditions = list[functionName];\n+const { Test } = require('./test');\n+const { globalNamespace } = require('./namespaces');\n+const reporters = require('./report');\n+\n+class DeclarativeTest extends Test {\n+  constructor(caption, list, namespaces) {\n+    super(caption, () => this._runCase(this.list));","path":"lib/case.js","position":30,"original_position":30,"commit_id":"70643b15a6a139eb12b2e893c035c493af50b42d","original_commit_id":"70643b15a6a139eb12b2e893c035c493af50b42d","user":{"login":"lundibundi","id":9109612,"node_id":"MDQ6VXNlcjkxMDk2MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/9109612?v=4","gravatar_id":"","url":"https://api.github.com/users/lundibundi","html_url":"https://github.com/lundibundi","followers_url":"https://api.github.com/users/lundibundi/followers","following_url":"https://api.github.com/users/lundibundi/following{/other_user}","gists_url":"https://api.github.com/users/lundibundi/gists{/gist_id}","starred_url":"https://api.github.com/users/lundibundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lundibundi/subscriptions","organizations_url":"https://api.github.com/users/lundibundi/orgs","repos_url":"https://api.github.com/users/lundibundi/repos","events_url":"https://api.github.com/users/lundibundi/events{/privacy}","received_events_url":"https://api.github.com/users/lundibundi/received_events","type":"User","site_admin":false},"body":"Well, `_runCase` I will fix that's a leftover from the previous thought-train.\r\n`checkCase` is just a `case`, but because `case` is a keyword I cannot name the function as such. As for the `case` function itself, it's needed to avoid having user manually create and configure `DeclarativeTest`. This greatly improves user experience if he doesn't need some specific customization. ","created_at":"2018-08-20T18:15:32Z","updated_at":"2018-08-20T18:15:32Z","html_url":"https://github.com/metarhia/metatests/pull/66#discussion_r211359037","pull_request_url":"https://api.github.com/repos/metarhia/metatests/pulls/66","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/metarhia/metatests/pulls/comments/211359037"},"html":{"href":"https://github.com/metarhia/metatests/pull/66#discussion_r211359037"},"pull_request":{"href":"https://api.github.com/repos/metarhia/metatests/pulls/66"}},"in_reply_to_id":211309737},"pull_request":{"url":"https://api.github.com/repos/metarhia/metatests/pulls/66","id":209364936,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MzY0OTM2","html_url":"https://github.com/metarhia/metatests/pull/66","diff_url":"https://github.com/metarhia/metatests/pull/66.diff","patch_url":"https://github.com/metarhia/metatests/pull/66.patch","issue_url":"https://api.github.com/repos/metarhia/metatests/issues/66","number":66,"state":"open","locked":false,"title":"Refactor whole tests to remove cyclic deps and add functionality","user":{"login":"lundibundi","id":9109612,"node_id":"MDQ6VXNlcjkxMDk2MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/9109612?v=4","gravatar_id":"","url":"https://api.github.com/users/lundibundi","html_url":"https://github.com/lundibundi","followers_url":"https://api.github.com/users/lundibundi/followers","following_url":"https://api.github.com/users/lundibundi/following{/other_user}","gists_url":"https://api.github.com/users/lundibundi/gists{/gist_id}","starred_url":"https://api.github.com/users/lundibundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lundibundi/subscriptions","organizations_url":"https://api.github.com/users/lundibundi/orgs","repos_url":"https://api.github.com/users/lundibundi/repos","events_url":"https://api.github.com/users/lundibundi/events{/privacy}","received_events_url":"https://api.github.com/users/lundibundi/received_events","type":"User","site_admin":false},"body":"* get rid of cyclic dependencies between modules\r\n\r\nNamespaces:\r\n* Add special Namespace class with add, get methods\r\n* Add compatibility namespace method and globalNamespace to use for all\r\n  tests by default\r\n\r\nReport:\r\n* Refactor Reporter class with general reporting functionality\r\n* Add SummaryReporter that behaves the same way as previous\r\n  implementaion and is used by default\r\n* Add SimpleReporter that just prints the result\r\n  (success/failure numbers)\r\n* 'report' method no longer triggers any tests - it only reports overall\r\n  result\r\n* 'addTest' method allows to add more tests to be reported by this\r\n  reporter\r\n* 'record' is called on each Test to parse/save the results of\r\n  individual tests\r\n* 'runTests' may run the test you passed to the reporter if available\r\n\r\nCase:\r\n* Refactor without globals and implicit dependencies on other modules\r\n* Clean up code, use Set, avoid unnecessary checks\r\n* Add DeclarativeTest that implements Test for declarative tests and has\r\n  _runCase method to run what previously 'case' method did;\r\n* Add 'case' function that just creates DeclarativeTest and uses default\r\n  namespace/reporter if not provided\r\n\r\nTest:\r\n* Refactor with es6 classes, clean up code and aliases\r\n* Now each test is separate and therefore any test-file can be run as a\r\n  separate program via just node (test will be by default run on\r\n  nextTick if not disabled val 'run = false' option)\r\n* Now all results are recorded including successful (this will allow to\r\n  provide rich error reporting later on and avoid unnecessary variables\r\n  to keep track of)\r\n* 'notOk' is now an alias of 'assetNot' (previously it was what 'fail'\r\n  does now)\r\n* Add 'fail' to fail the test immediately with specified error message\r\n* Add 'test' that adds a subtest to this test. This test will end\r\n  when all subtests have finished.\r\n* Allow to listen on test finish event .on('done', (test) => {})\r\n* Add test timeout (30s default) that will fail the test if it hasn't\r\n  finished within the timeout time\r\n* Test plan now properly checks and finished the test\r\n* Tests can now have metadata (this is used by case/DeclarativeTest to\r\n  report additional information)\r\n* Tests now store results of all checks in 'results'","created_at":"2018-08-19T15:16:25Z","updated_at":"2018-08-20T18:15:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"072740b3a7c91a6d6272072718594f1707337d86","assignee":{"login":"lundibundi","id":9109612,"node_id":"MDQ6VXNlcjkxMDk2MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/9109612?v=4","gravatar_id":"","url":"https://api.github.com/users/lundibundi","html_url":"https://github.com/lundibundi","followers_url":"https://api.github.com/users/lundibundi/followers","following_url":"https://api.github.com/users/lundibundi/following{/other_user}","gists_url":"https://api.github.com/users/lundibundi/gists{/gist_id}","starred_url":"https://api.github.com/users/lundibundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lundibundi/subscriptions","organizations_url":"https://api.github.com/users/lundibundi/orgs","repos_url":"https://api.github.com/users/lundibundi/repos","events_url":"https://api.github.com/users/lundibundi/events{/privacy}","received_events_url":"https://api.github.com/users/lundibundi/received_events","type":"User","site_admin":false},"assignees":[{"login":"lundibundi","id":9109612,"node_id":"MDQ6VXNlcjkxMDk2MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/9109612?v=4","gravatar_id":"","url":"https://api.github.com/users/lundibundi","html_url":"https://github.com/lundibundi","followers_url":"https://api.github.com/users/lundibundi/followers","following_url":"https://api.github.com/users/lundibundi/following{/other_user}","gists_url":"https://api.github.com/users/lundibundi/gists{/gist_id}","starred_url":"https://api.github.com/users/lundibundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lundibundi/subscriptions","organizations_url":"https://api.github.com/users/lundibundi/orgs","repos_url":"https://api.github.com/users/lundibundi/repos","events_url":"https://api.github.com/users/lundibundi/events{/privacy}","received_events_url":"https://api.github.com/users/lundibundi/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":494036055,"node_id":"MDU6TGFiZWw0OTQwMzYwNTU=","url":"https://api.github.com/repos/metarhia/metatests/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/metarhia/metatests/pulls/66/commits","review_comments_url":"https://api.github.com/repos/metarhia/metatests/pulls/66/comments","review_comment_url":"https://api.github.com/repos/metarhia/metatests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metarhia/metatests/issues/66/comments","statuses_url":"https://api.github.com/repos/metarhia/metatests/statuses/70643b15a6a139eb12b2e893c035c493af50b42d","head":{"label":"metarhia:refactor-case","ref":"refactor-case","sha":"70643b15a6a139eb12b2e893c035c493af50b42d","user":{"login":"metarhia","id":18060695,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MDYwNjk1","avatar_url":"https://avatars2.githubusercontent.com/u/18060695?v=4","gravatar_id":"","url":"https://api.github.com/users/metarhia","html_url":"https://github.com/metarhia","followers_url":"https://api.github.com/users/metarhia/followers","following_url":"https://api.github.com/users/metarhia/following{/other_user}","gists_url":"https://api.github.com/users/metarhia/gists{/gist_id}","starred_url":"https://api.github.com/users/metarhia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metarhia/subscriptions","organizations_url":"https://api.github.com/users/metarhia/orgs","repos_url":"https://api.github.com/users/metarhia/repos","events_url":"https://api.github.com/users/metarhia/events{/privacy}","received_events_url":"https://api.github.com/users/metarhia/received_events","type":"Organization","site_admin":false},"repo":{"id":75518889,"node_id":"MDEwOlJlcG9zaXRvcnk3NTUxODg4OQ==","name":"metatests","full_name":"metarhia/metatests","owner":{"login":"metarhia","id":18060695,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MDYwNjk1","avatar_url":"https://avatars2.githubusercontent.com/u/18060695?v=4","gravatar_id":"","url":"https://api.github.com/users/metarhia","html_url":"https://github.com/metarhia","followers_url":"https://api.github.com/users/metarhia/followers","following_url":"https://api.github.com/users/metarhia/following{/other_user}","gists_url":"https://api.github.com/users/metarhia/gists{/gist_id}","starred_url":"https://api.github.com/users/metarhia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metarhia/subscriptions","organizations_url":"https://api.github.com/users/metarhia/orgs","repos_url":"https://api.github.com/users/metarhia/repos","events_url":"https://api.github.com/users/metarhia/events{/privacy}","received_events_url":"https://api.github.com/users/metarhia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metarhia/metatests","description":"Extremely simple to use test framework and runner for Metarhia technology stack","fork":false,"url":"https://api.github.com/repos/metarhia/metatests","forks_url":"https://api.github.com/repos/metarhia/metatests/forks","keys_url":"https://api.github.com/repos/metarhia/metatests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metarhia/metatests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metarhia/metatests/teams","hooks_url":"https://api.github.com/repos/metarhia/metatests/hooks","issue_events_url":"https://api.github.com/repos/metarhia/metatests/issues/events{/number}","events_url":"https://api.github.com/repos/metarhia/metatests/events","assignees_url":"https://api.github.com/repos/metarhia/metatests/assignees{/user}","branches_url":"https://api.github.com/repos/metarhia/metatests/branches{/branch}","tags_url":"https://api.github.com/repos/metarhia/metatests/tags","blobs_url":"https://api.github.com/repos/metarhia/metatests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metarhia/metatests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metarhia/metatests/git/refs{/sha}","trees_url":"https://api.github.com/repos/metarhia/metatests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metarhia/metatests/statuses/{sha}","languages_url":"https://api.github.com/repos/metarhia/metatests/languages","stargazers_url":"https://api.github.com/repos/metarhia/metatests/stargazers","contributors_url":"https://api.github.com/repos/metarhia/metatests/contributors","subscribers_url":"https://api.github.com/repos/metarhia/metatests/subscribers","subscription_url":"https://api.github.com/repos/metarhia/metatests/subscription","commits_url":"https://api.github.com/repos/metarhia/metatests/commits{/sha}","git_commits_url":"https://api.github.com/repos/metarhia/metatests/git/commits{/sha}","comments_url":"https://api.github.com/repos/metarhia/metatests/comments{/number}","issue_comment_url":"https://api.github.com/repos/metarhia/metatests/issues/comments{/number}","contents_url":"https://api.github.com/repos/metarhia/metatests/contents/{+path}","compare_url":"https://api.github.com/repos/metarhia/metatests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metarhia/metatests/merges","archive_url":"https://api.github.com/repos/metarhia/metatests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metarhia/metatests/downloads","issues_url":"https://api.github.com/repos/metarhia/metatests/issues{/number}","pulls_url":"https://api.github.com/repos/metarhia/metatests/pulls{/number}","milestones_url":"https://api.github.com/repos/metarhia/metatests/milestones{/number}","notifications_url":"https://api.github.com/repos/metarhia/metatests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metarhia/metatests/labels{/name}","releases_url":"https://api.github.com/repos/metarhia/metatests/releases{/id}","deployments_url":"https://api.github.com/repos/metarhia/metatests/deployments","created_at":"2016-12-04T05:15:08Z","updated_at":"2018-08-07T03:20:06Z","pushed_at":"2018-08-19T18:04:40Z","git_url":"git://github.com/metarhia/metatests.git","ssh_url":"git@github.com:metarhia/metatests.git","clone_url":"https://github.com/metarhia/metatests.git","svn_url":"https://github.com/metarhia/metatests","homepage":"","size":151,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2,"open_issues":20,"watchers":5,"default_branch":"master"}},"base":{"label":"metarhia:master","ref":"master","sha":"196c26af30fa8370266c94695f60456593aa9160","user":{"login":"metarhia","id":18060695,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MDYwNjk1","avatar_url":"https://avatars2.githubusercontent.com/u/18060695?v=4","gravatar_id":"","url":"https://api.github.com/users/metarhia","html_url":"https://github.com/metarhia","followers_url":"https://api.github.com/users/metarhia/followers","following_url":"https://api.github.com/users/metarhia/following{/other_user}","gists_url":"https://api.github.com/users/metarhia/gists{/gist_id}","starred_url":"https://api.github.com/users/metarhia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metarhia/subscriptions","organizations_url":"https://api.github.com/users/metarhia/orgs","repos_url":"https://api.github.com/users/metarhia/repos","events_url":"https://api.github.com/users/metarhia/events{/privacy}","received_events_url":"https://api.github.com/users/metarhia/received_events","type":"Organization","site_admin":false},"repo":{"id":75518889,"node_id":"MDEwOlJlcG9zaXRvcnk3NTUxODg4OQ==","name":"metatests","full_name":"metarhia/metatests","owner":{"login":"metarhia","id":18060695,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MDYwNjk1","avatar_url":"https://avatars2.githubusercontent.com/u/18060695?v=4","gravatar_id":"","url":"https://api.github.com/users/metarhia","html_url":"https://github.com/metarhia","followers_url":"https://api.github.com/users/metarhia/followers","following_url":"https://api.github.com/users/metarhia/following{/other_user}","gists_url":"https://api.github.com/users/metarhia/gists{/gist_id}","starred_url":"https://api.github.com/users/metarhia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metarhia/subscriptions","organizations_url":"https://api.github.com/users/metarhia/orgs","repos_url":"https://api.github.com/users/metarhia/repos","events_url":"https://api.github.com/users/metarhia/events{/privacy}","received_events_url":"https://api.github.com/users/metarhia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metarhia/metatests","description":"Extremely simple to use test framework and runner for Metarhia technology stack","fork":false,"url":"https://api.github.com/repos/metarhia/metatests","forks_url":"https://api.github.com/repos/metarhia/metatests/forks","keys_url":"https://api.github.com/repos/metarhia/metatests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metarhia/metatests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metarhia/metatests/teams","hooks_url":"https://api.github.com/repos/metarhia/metatests/hooks","issue_events_url":"https://api.github.com/repos/metarhia/metatests/issues/events{/number}","events_url":"https://api.github.com/repos/metarhia/metatests/events","assignees_url":"https://api.github.com/repos/metarhia/metatests/assignees{/user}","branches_url":"https://api.github.com/repos/metarhia/metatests/branches{/branch}","tags_url":"https://api.github.com/repos/metarhia/metatests/tags","blobs_url":"https://api.github.com/repos/metarhia/metatests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metarhia/metatests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metarhia/metatests/git/refs{/sha}","trees_url":"https://api.github.com/repos/metarhia/metatests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metarhia/metatests/statuses/{sha}","languages_url":"https://api.github.com/repos/metarhia/metatests/languages","stargazers_url":"https://api.github.com/repos/metarhia/metatests/stargazers","contributors_url":"https://api.github.com/repos/metarhia/metatests/contributors","subscribers_url":"https://api.github.com/repos/metarhia/metatests/subscribers","subscription_url":"https://api.github.com/repos/metarhia/metatests/subscription","commits_url":"https://api.github.com/repos/metarhia/metatests/commits{/sha}","git_commits_url":"https://api.github.com/repos/metarhia/metatests/git/commits{/sha}","comments_url":"https://api.github.com/repos/metarhia/metatests/comments{/number}","issue_comment_url":"https://api.github.com/repos/metarhia/metatests/issues/comments{/number}","contents_url":"https://api.github.com/repos/metarhia/metatests/contents/{+path}","compare_url":"https://api.github.com/repos/metarhia/metatests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metarhia/metatests/merges","archive_url":"https://api.github.com/repos/metarhia/metatests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metarhia/metatests/downloads","issues_url":"https://api.github.com/repos/metarhia/metatests/issues{/number}","pulls_url":"https://api.github.com/repos/metarhia/metatests/pulls{/number}","milestones_url":"https://api.github.com/repos/metarhia/metatests/milestones{/number}","notifications_url":"https://api.github.com/repos/metarhia/metatests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metarhia/metatests/labels{/name}","releases_url":"https://api.github.com/repos/metarhia/metatests/releases{/id}","deployments_url":"https://api.github.com/repos/metarhia/metatests/deployments","created_at":"2016-12-04T05:15:08Z","updated_at":"2018-08-07T03:20:06Z","pushed_at":"2018-08-19T18:04:40Z","git_url":"git://github.com/metarhia/metatests.git","ssh_url":"git@github.com:metarhia/metatests.git","clone_url":"https://github.com/metarhia/metatests.git","svn_url":"https://github.com/metarhia/metatests","homepage":"","size":151,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2,"open_issues":20,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metarhia/metatests/pulls/66"},"html":{"href":"https://github.com/metarhia/metatests/pull/66"},"issue":{"href":"https://api.github.com/repos/metarhia/metatests/issues/66"},"comments":{"href":"https://api.github.com/repos/metarhia/metatests/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/metarhia/metatests/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/metarhia/metatests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metarhia/metatests/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/metarhia/metatests/statuses/70643b15a6a139eb12b2e893c035c493af50b42d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lundibundi"}}