{"action":"created","comment":{"url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/comments/51039707","id":51039707,"diff_hunk":"@@ -0,0 +1,203 @@\n+/**\n+ * File: javascript-wrapper.js\n+ * Unit tests for the APIs defined in components/javascript-wrapper.js\n+ */\n+\n+var chai = require('chai');\n+\n+var chaiAsPromised = require('chai-as-promised');\n+chai.use(chaiAsPromised);\n+\n+var expect = chai.expect;\n+var should = chai.should();\n+\n+var sinon = require('sinon');\n+\n+var _ = require('underscore');\n+var noflo = require('noflo');\n+\n+var jswrapper = require('../components/javascript-wrapper');\n+var commonTest = require('./common-test');\n+\n+describe('javascript-wrapper', function() {\n+\n+    it('should exist as an object', function() {\n+        jswrapper.should.exist;\n+        jswrapper.should.be.a('function');\n+    });\n+\n+    it(\"should reject undefined definition\", function() {\n+        return Promise.resolve().then(jswrapper).should.be.rejected;\n+    });\n+\n+    it(\"should reject empty definition\", function() {\n+        return Promise.resolve({}).then(jswrapper).should.be.rejected;\n+    });\n+\n+    it(\"should reject empty inPorts\", function() {\n+        return Promise.resolve({inPorts:{}}).then(jswrapper).should.be.rejected;\n+    });\n+\n+    it(\"should accept array of inPort names\", function() {\n+        return Promise.resolve({\n+            inPorts:['in']\n+        }).then(jswrapper).then(commonTest.createComponent).then(function(component){\n+            return _.keys(component.inPorts);\n+        }).should.eventually.contain('in');\n+    });\n+\n+    it(\"should accept object with one inPort definition\", function() {\n+        return Promise.resolve({\n+            inPorts: { \n+                in: { datatype: 'string', \n+                      description: \"input description\",\n+                      required: true }\n+            }\n+        }).then(jswrapper).then(commonTest.createComponent).then(function(component){\n+            return _.keys(component.inPorts);\n+        }).should.eventually.contain('in');\n+    });\n+\n+    it(\"should trigger onchange function if no updater\", function() {","path":"test/javascript-wrapper-mocha.js","position":61,"original_position":61,"commit_id":"fa80511386ed1e1d5066b0ef3fce8e4218d3c0f3","original_commit_id":"fa80511386ed1e1d5066b0ef3fce8e4218d3c0f3","user":{"login":"jamesrdf","id":881923,"avatar_url":"https://avatars.githubusercontent.com/u/881923?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesrdf","html_url":"https://github.com/jamesrdf","followers_url":"https://api.github.com/users/jamesrdf/followers","following_url":"https://api.github.com/users/jamesrdf/following{/other_user}","gists_url":"https://api.github.com/users/jamesrdf/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesrdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesrdf/subscriptions","organizations_url":"https://api.github.com/users/jamesrdf/orgs","repos_url":"https://api.github.com/users/jamesrdf/repos","events_url":"https://api.github.com/users/jamesrdf/events{/privacy}","received_events_url":"https://api.github.com/users/jamesrdf/received_events","type":"User","site_admin":false},"body":"What should happen if passed both an onchange and updater function?","created_at":"2016-01-27T19:50:19Z","updated_at":"2016-01-27T19:50:19Z","html_url":"https://github.com/rdf-pipeline/noflo-rdf-components/pull/10#discussion_r51039707","pull_request_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/comments/51039707"},"html":{"href":"https://github.com/rdf-pipeline/noflo-rdf-components/pull/10#discussion_r51039707"},"pull_request":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/10","id":57406511,"html_url":"https://github.com/rdf-pipeline/noflo-rdf-components/pull/10","diff_url":"https://github.com/rdf-pipeline/noflo-rdf-components/pull/10.diff","patch_url":"https://github.com/rdf-pipeline/noflo-rdf-components/pull/10.patch","issue_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues/10","number":10,"state":"open","locked":false,"title":"Javascript wrapper","user":{"login":"glenna-m","id":14930078,"avatar_url":"https://avatars.githubusercontent.com/u/14930078?v=3","gravatar_id":"","url":"https://api.github.com/users/glenna-m","html_url":"https://github.com/glenna-m","followers_url":"https://api.github.com/users/glenna-m/followers","following_url":"https://api.github.com/users/glenna-m/following{/other_user}","gists_url":"https://api.github.com/users/glenna-m/gists{/gist_id}","starred_url":"https://api.github.com/users/glenna-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glenna-m/subscriptions","organizations_url":"https://api.github.com/users/glenna-m/orgs","repos_url":"https://api.github.com/users/glenna-m/repos","events_url":"https://api.github.com/users/glenna-m/events{/privacy}","received_events_url":"https://api.github.com/users/glenna-m/received_events","type":"User","site_admin":false},"body":"Ready for review with James' state-component","created_at":"2016-01-27T19:04:41Z","updated_at":"2016-01-27T19:50:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"003ef176e91ff93436b2282f7316160cb225a5d1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/10/commits","review_comments_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/10/comments","review_comment_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues/10/comments","statuses_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/statuses/fa80511386ed1e1d5066b0ef3fce8e4218d3c0f3","head":{"label":"rdf-pipeline:javascript-wrapper","ref":"javascript-wrapper","sha":"fa80511386ed1e1d5066b0ef3fce8e4218d3c0f3","user":{"login":"rdf-pipeline","id":10980355,"avatar_url":"https://avatars.githubusercontent.com/u/10980355?v=3","gravatar_id":"","url":"https://api.github.com/users/rdf-pipeline","html_url":"https://github.com/rdf-pipeline","followers_url":"https://api.github.com/users/rdf-pipeline/followers","following_url":"https://api.github.com/users/rdf-pipeline/following{/other_user}","gists_url":"https://api.github.com/users/rdf-pipeline/gists{/gist_id}","starred_url":"https://api.github.com/users/rdf-pipeline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdf-pipeline/subscriptions","organizations_url":"https://api.github.com/users/rdf-pipeline/orgs","repos_url":"https://api.github.com/users/rdf-pipeline/repos","events_url":"https://api.github.com/users/rdf-pipeline/events{/privacy}","received_events_url":"https://api.github.com/users/rdf-pipeline/received_events","type":"Organization","site_admin":false},"repo":{"id":46297514,"name":"noflo-rdf-components","full_name":"rdf-pipeline/noflo-rdf-components","owner":{"login":"rdf-pipeline","id":10980355,"avatar_url":"https://avatars.githubusercontent.com/u/10980355?v=3","gravatar_id":"","url":"https://api.github.com/users/rdf-pipeline","html_url":"https://github.com/rdf-pipeline","followers_url":"https://api.github.com/users/rdf-pipeline/followers","following_url":"https://api.github.com/users/rdf-pipeline/following{/other_user}","gists_url":"https://api.github.com/users/rdf-pipeline/gists{/gist_id}","starred_url":"https://api.github.com/users/rdf-pipeline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdf-pipeline/subscriptions","organizations_url":"https://api.github.com/users/rdf-pipeline/orgs","repos_url":"https://api.github.com/users/rdf-pipeline/repos","events_url":"https://api.github.com/users/rdf-pipeline/events{/privacy}","received_events_url":"https://api.github.com/users/rdf-pipeline/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rdf-pipeline/noflo-rdf-components","description":"NoFlo components for processing RDF related content","fork":false,"url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components","forks_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/forks","keys_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/teams","hooks_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/hooks","issue_events_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues/events{/number}","events_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/events","assignees_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/assignees{/user}","branches_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/branches{/branch}","tags_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/tags","blobs_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/statuses/{sha}","languages_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/languages","stargazers_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/stargazers","contributors_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/contributors","subscribers_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/subscribers","subscription_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/subscription","commits_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/contents/{+path}","compare_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/merges","archive_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/downloads","issues_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues{/number}","pulls_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls{/number}","milestones_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/milestones{/number}","notifications_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/labels{/name}","releases_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/releases{/id}","deployments_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/deployments","created_at":"2015-11-16T19:37:01Z","updated_at":"2016-01-20T18:46:45Z","pushed_at":"2016-01-27T19:04:41Z","git_url":"git://github.com/rdf-pipeline/noflo-rdf-components.git","ssh_url":"git@github.com:rdf-pipeline/noflo-rdf-components.git","clone_url":"https://github.com/rdf-pipeline/noflo-rdf-components.git","svn_url":"https://github.com/rdf-pipeline/noflo-rdf-components","homepage":null,"size":136,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"rdf-pipeline:master","ref":"master","sha":"fde917ef6e415b006e305828231458b19b5b1cc6","user":{"login":"rdf-pipeline","id":10980355,"avatar_url":"https://avatars.githubusercontent.com/u/10980355?v=3","gravatar_id":"","url":"https://api.github.com/users/rdf-pipeline","html_url":"https://github.com/rdf-pipeline","followers_url":"https://api.github.com/users/rdf-pipeline/followers","following_url":"https://api.github.com/users/rdf-pipeline/following{/other_user}","gists_url":"https://api.github.com/users/rdf-pipeline/gists{/gist_id}","starred_url":"https://api.github.com/users/rdf-pipeline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdf-pipeline/subscriptions","organizations_url":"https://api.github.com/users/rdf-pipeline/orgs","repos_url":"https://api.github.com/users/rdf-pipeline/repos","events_url":"https://api.github.com/users/rdf-pipeline/events{/privacy}","received_events_url":"https://api.github.com/users/rdf-pipeline/received_events","type":"Organization","site_admin":false},"repo":{"id":46297514,"name":"noflo-rdf-components","full_name":"rdf-pipeline/noflo-rdf-components","owner":{"login":"rdf-pipeline","id":10980355,"avatar_url":"https://avatars.githubusercontent.com/u/10980355?v=3","gravatar_id":"","url":"https://api.github.com/users/rdf-pipeline","html_url":"https://github.com/rdf-pipeline","followers_url":"https://api.github.com/users/rdf-pipeline/followers","following_url":"https://api.github.com/users/rdf-pipeline/following{/other_user}","gists_url":"https://api.github.com/users/rdf-pipeline/gists{/gist_id}","starred_url":"https://api.github.com/users/rdf-pipeline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdf-pipeline/subscriptions","organizations_url":"https://api.github.com/users/rdf-pipeline/orgs","repos_url":"https://api.github.com/users/rdf-pipeline/repos","events_url":"https://api.github.com/users/rdf-pipeline/events{/privacy}","received_events_url":"https://api.github.com/users/rdf-pipeline/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rdf-pipeline/noflo-rdf-components","description":"NoFlo components for processing RDF related content","fork":false,"url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components","forks_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/forks","keys_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/teams","hooks_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/hooks","issue_events_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues/events{/number}","events_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/events","assignees_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/assignees{/user}","branches_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/branches{/branch}","tags_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/tags","blobs_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/statuses/{sha}","languages_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/languages","stargazers_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/stargazers","contributors_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/contributors","subscribers_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/subscribers","subscription_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/subscription","commits_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/contents/{+path}","compare_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/merges","archive_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/downloads","issues_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues{/number}","pulls_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls{/number}","milestones_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/milestones{/number}","notifications_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/labels{/name}","releases_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/releases{/id}","deployments_url":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/deployments","created_at":"2015-11-16T19:37:01Z","updated_at":"2016-01-20T18:46:45Z","pushed_at":"2016-01-27T19:04:41Z","git_url":"git://github.com/rdf-pipeline/noflo-rdf-components.git","ssh_url":"git@github.com:rdf-pipeline/noflo-rdf-components.git","clone_url":"https://github.com/rdf-pipeline/noflo-rdf-components.git","svn_url":"https://github.com/rdf-pipeline/noflo-rdf-components","homepage":null,"size":136,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/10"},"html":{"href":"https://github.com/rdf-pipeline/noflo-rdf-components/pull/10"},"issue":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues/10"},"comments":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/rdf-pipeline/noflo-rdf-components/statuses/fa80511386ed1e1d5066b0ef3fce8e4218d3c0f3"}}}}