{"action":"created","comment":{"url":"https://api.github.com/repos/danliris/bateeq-module/pulls/comments/215839482","pull_request_review_id":153195475,"id":215839482,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTgzOTQ4Mg==","diff_hunk":"@@ -0,0 +1,239 @@\n+var helper = require(\"../../../helper\");\n+var should = require(\"should\");\n+\n+function getBasicTest(opt) {\n+\n+    var options = opt || {};\n+    var Manager = options.manager;\n+    var Model = options.model;\n+    var dataUtil = options.util;\n+    var validate = options.validator;\n+    var createDuplicate = options.createDuplicate;\n+    var keys = options.keys;\n+\n+    var manager;\n+    before(\"#00. connect db\", function (done) {\n+        helper.getDb()\n+            .then((db) => {\n+                manager = new Manager(db, {\n+                    username: \"unit-test\"\n+                });\n+                done();\n+            })\n+            .catch(e => {\n+                done(e);\n+            });\n+    });\n+\n+    it(\"#01. should error when create with empty data\", function (done) {\n+        manager.create({})\n+            .then((id) => {\n+                done(\"Should not be able to create with empty data\");\n+            })\n+            .catch((e) => {\n+                try {\n+                    e.name.should.equal(\"ValidationError\");\n+                    e.should.have.property(\"errors\");\n+                    e.errors.should.instanceof(Object);\n+                    done();\n+                }\n+                catch (ex) {\n+                    done(e);\n+                }\n+            });\n+    });\n+\n+    var createdId;\n+    it(\"#02. should success when create new data\", function (done) {\n+        dataUtil.getNewData()\n+            .then((data) => {\n+                manager.create(data)\n+                    .then((id) => {\n+                        id.should.be.Object();\n+                        createdId = id;\n+                        done();\n+                    })\n+                    .catch((e) => {\n+                        done(e);\n+                    });\n+            })\n+            .catch((e) => {\n+                done(e);\n+            });\n+    });\n+\n+    var createdData;\n+    it(`#03. should success when get created data with id`, function (done) {\n+        manager.getSingleById(createdId)\n+            .then((data) => {\n+                data.should.instanceof(Object);\n+                validate(data);\n+                createdData = data;\n+                done();\n+            })\n+            .catch((e) => {\n+                done(e);\n+            });\n+    });\n+\n+    it(\"#04. should error when create new data with same key(s)\", function (done) {\n+        if (!createDuplicate || keys.length <= 0)\n+            this.skip();\n+        else {\n+            var data = Object.assign({}, createdData);\n+            delete data._id;\n+\n+            manager.create(data)\n+                .then((id) => {\n+                    done(\"Should not be able to create data with same key(s)\");\n+                })\n+                .catch((e) => {\n+                    try {\n+                        e.name.should.equal(\"ValidationError\");\n+                        e.should.have.property(\"errors\");\n+                        e.errors.should.instanceof(Object);\n+                        for (var key of keys) {\n+                            e.errors.should.have.property(key);\n+                        }\n+                        done();\n+                    }\n+                    catch (ex) {\n+                        done(e);\n+                    }\n+                });\n+\n+        }\n+    });\n+\n+    it(`#05. should success when update created data`, function (done) {\n+        manager.update(createdData)\n+            .then((id) => {\n+                createdId.toString().should.equal(id.toString());\n+                done();\n+            })\n+            .catch((e) => {\n+                done(e);\n+            });\n+    });\n+\n+    it(`#06. should success when get updated data with id`, function (done) {\n+        manager.getSingleById(createdId)\n+            .then((data) => {\n+                validate(data);\n+                data._stamp.should.not.equal(createdData._stamp);\n+                done();\n+            })\n+            .catch((e) => {\n+                done(e);\n+            });\n+    });\n+\n+    it(\"#07. should error when update new data with same key(s)\", function (done) {\n+        if (keys.length <= 0)\n+            this.skip();\n+        else {\n+            var newDataId;\n+            dataUtil.getNewData()\n+                .then((data) => manager.create(data))\n+                .then((newId) => manager.getSingleById(newId))\n+                .then((newData) => {\n+                    newDataId = newData._id;\n+                    for (var key of keys) {\n+                        newData[key] = createdData[key];\n+                    }\n+                    return manager.update(newData);\n+                })\n+                .then((id) => {\n+                    done(\"Should not be able to update data with key(s)\");\n+                })\n+                .catch((e) => {\n+                    try {\n+                        e.name.should.equal(\"ValidationError\");\n+                        e.should.have.property(\"errors\");\n+                        e.errors.should.instanceof(Object);\n+                        for (var key of keys) {\n+                            e.errors.should.have.property(key);\n+                        }\n+                        manager.destroy(newDataId)\n+                            .then(() => done());\n+                    }\n+                    catch (ex) {\n+                        done(e);\n+                    }\n+                });\n+        }\n+    });\n+\n+    it(\"#08. should success when read data\", function (done) {\n+        if (keys.length <= 0)\n+            this.skip();\n+        else {\n+            manager.read({\n+                filter: {\n+                    _id: createdId\n+                }\n+            })\n+                .then((documents) => {\n+                    //process documents\n+                    documents.should.have.property(\"data\");\n+                    documents.data.should.be.instanceof(Array);\n+                    documents.data.length.should.not.equal(0);\n+                    done();\n+                })\n+                .catch((e) => {\n+                    done(e);\n+                });\n+        }\n+    });\n+\n+    it(`#09. should success when delete data`, function (done) {\n+        manager.delete(createdData)\n+            .then((id) => {\n+                id.toString().should.equal(createdId.toString());\n+                done();\n+            })\n+            .catch((e) => {\n+                done(e);\n+            });\n+    });\n+\n+\n+    it(`#10. should _deleted=true`, function (done) {\n+        manager.getSingleByQuery({\n+            _id: createdId\n+        })\n+            .then((data) => {\n+                validate(data);\n+                data._deleted.should.be.Boolean();\n+                data._deleted.should.equal(true);\n+                done();\n+            })\n+            .catch((e) => {\n+                done(e);\n+            });\n+    });\n+\n+    it(\"#11. should success when destroy data with id\", function (done) {\n+        manager.destroy(createdId)\n+            .then((result) => {\n+                result.should.be.Boolean();\n+                result.should.equal(true);\n+                done();\n+            })\n+            .catch((e) => {\n+                done(e);\n+            });\n+    });\n+\n+    it(`#12. should null when get destroyed data`, function (done) {\n+        manager.getSingleByIdOrDefault(createdId)\n+            .then((data) => {\n+                should.equal(data, null);\n+                done();\n+            })\n+            .catch((e) => {","path":"test/managers/purchasing/price-correction/price-correction-test.js","position":234,"original_position":234,"commit_id":"9e874fcfe02576ae87045890343ce1225937c333","original_commit_id":"9e874fcfe02576ae87045890343ce1225937c333","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').","created_at":"2018-09-07T03:51:50Z","updated_at":"2018-09-07T03:51:51Z","html_url":"https://github.com/danliris/bateeq-module/pull/598#discussion_r215839482","pull_request_url":"https://api.github.com/repos/danliris/bateeq-module/pulls/598","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/comments/215839482"},"html":{"href":"https://github.com/danliris/bateeq-module/pull/598#discussion_r215839482"},"pull_request":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/598"}}},"pull_request":{"url":"https://api.github.com/repos/danliris/bateeq-module/pulls/598","id":213809299,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzODA5Mjk5","html_url":"https://github.com/danliris/bateeq-module/pull/598","diff_url":"https://github.com/danliris/bateeq-module/pull/598.diff","patch_url":"https://github.com/danliris/bateeq-module/pull/598.patch","issue_url":"https://api.github.com/repos/danliris/bateeq-module/issues/598","number":598,"state":"open","locked":false,"title":"unit_test","user":{"login":"andibateeq","id":28917159,"node_id":"MDQ6VXNlcjI4OTE3MTU5","avatar_url":"https://avatars0.githubusercontent.com/u/28917159?v=4","gravatar_id":"","url":"https://api.github.com/users/andibateeq","html_url":"https://github.com/andibateeq","followers_url":"https://api.github.com/users/andibateeq/followers","following_url":"https://api.github.com/users/andibateeq/following{/other_user}","gists_url":"https://api.github.com/users/andibateeq/gists{/gist_id}","starred_url":"https://api.github.com/users/andibateeq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andibateeq/subscriptions","organizations_url":"https://api.github.com/users/andibateeq/orgs","repos_url":"https://api.github.com/users/andibateeq/repos","events_url":"https://api.github.com/users/andibateeq/events{/privacy}","received_events_url":"https://api.github.com/users/andibateeq/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-07T03:51:34Z","updated_at":"2018-09-07T03:51:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/danliris/bateeq-module/pulls/598/commits","review_comments_url":"https://api.github.com/repos/danliris/bateeq-module/pulls/598/comments","review_comment_url":"https://api.github.com/repos/danliris/bateeq-module/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danliris/bateeq-module/issues/598/comments","statuses_url":"https://api.github.com/repos/danliris/bateeq-module/statuses/9e874fcfe02576ae87045890343ce1225937c333","head":{"label":"andibateeq:dev","ref":"dev","sha":"9e874fcfe02576ae87045890343ce1225937c333","user":{"login":"andibateeq","id":28917159,"node_id":"MDQ6VXNlcjI4OTE3MTU5","avatar_url":"https://avatars0.githubusercontent.com/u/28917159?v=4","gravatar_id":"","url":"https://api.github.com/users/andibateeq","html_url":"https://github.com/andibateeq","followers_url":"https://api.github.com/users/andibateeq/followers","following_url":"https://api.github.com/users/andibateeq/following{/other_user}","gists_url":"https://api.github.com/users/andibateeq/gists{/gist_id}","starred_url":"https://api.github.com/users/andibateeq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andibateeq/subscriptions","organizations_url":"https://api.github.com/users/andibateeq/orgs","repos_url":"https://api.github.com/users/andibateeq/repos","events_url":"https://api.github.com/users/andibateeq/events{/privacy}","received_events_url":"https://api.github.com/users/andibateeq/received_events","type":"User","site_admin":false},"repo":{"id":92461657,"node_id":"MDEwOlJlcG9zaXRvcnk5MjQ2MTY1Nw==","name":"bateeq-module","full_name":"andibateeq/bateeq-module","owner":{"login":"andibateeq","id":28917159,"node_id":"MDQ6VXNlcjI4OTE3MTU5","avatar_url":"https://avatars0.githubusercontent.com/u/28917159?v=4","gravatar_id":"","url":"https://api.github.com/users/andibateeq","html_url":"https://github.com/andibateeq","followers_url":"https://api.github.com/users/andibateeq/followers","following_url":"https://api.github.com/users/andibateeq/following{/other_user}","gists_url":"https://api.github.com/users/andibateeq/gists{/gist_id}","starred_url":"https://api.github.com/users/andibateeq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andibateeq/subscriptions","organizations_url":"https://api.github.com/users/andibateeq/orgs","repos_url":"https://api.github.com/users/andibateeq/repos","events_url":"https://api.github.com/users/andibateeq/events{/privacy}","received_events_url":"https://api.github.com/users/andibateeq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andibateeq/bateeq-module","description":"bateeq module","fork":true,"url":"https://api.github.com/repos/andibateeq/bateeq-module","forks_url":"https://api.github.com/repos/andibateeq/bateeq-module/forks","keys_url":"https://api.github.com/repos/andibateeq/bateeq-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andibateeq/bateeq-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andibateeq/bateeq-module/teams","hooks_url":"https://api.github.com/repos/andibateeq/bateeq-module/hooks","issue_events_url":"https://api.github.com/repos/andibateeq/bateeq-module/issues/events{/number}","events_url":"https://api.github.com/repos/andibateeq/bateeq-module/events","assignees_url":"https://api.github.com/repos/andibateeq/bateeq-module/assignees{/user}","branches_url":"https://api.github.com/repos/andibateeq/bateeq-module/branches{/branch}","tags_url":"https://api.github.com/repos/andibateeq/bateeq-module/tags","blobs_url":"https://api.github.com/repos/andibateeq/bateeq-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andibateeq/bateeq-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andibateeq/bateeq-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/andibateeq/bateeq-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andibateeq/bateeq-module/statuses/{sha}","languages_url":"https://api.github.com/repos/andibateeq/bateeq-module/languages","stargazers_url":"https://api.github.com/repos/andibateeq/bateeq-module/stargazers","contributors_url":"https://api.github.com/repos/andibateeq/bateeq-module/contributors","subscribers_url":"https://api.github.com/repos/andibateeq/bateeq-module/subscribers","subscription_url":"https://api.github.com/repos/andibateeq/bateeq-module/subscription","commits_url":"https://api.github.com/repos/andibateeq/bateeq-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/andibateeq/bateeq-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/andibateeq/bateeq-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/andibateeq/bateeq-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/andibateeq/bateeq-module/contents/{+path}","compare_url":"https://api.github.com/repos/andibateeq/bateeq-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andibateeq/bateeq-module/merges","archive_url":"https://api.github.com/repos/andibateeq/bateeq-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andibateeq/bateeq-module/downloads","issues_url":"https://api.github.com/repos/andibateeq/bateeq-module/issues{/number}","pulls_url":"https://api.github.com/repos/andibateeq/bateeq-module/pulls{/number}","milestones_url":"https://api.github.com/repos/andibateeq/bateeq-module/milestones{/number}","notifications_url":"https://api.github.com/repos/andibateeq/bateeq-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andibateeq/bateeq-module/labels{/name}","releases_url":"https://api.github.com/repos/andibateeq/bateeq-module/releases{/id}","deployments_url":"https://api.github.com/repos/andibateeq/bateeq-module/deployments","created_at":"2017-05-26T02:01:28Z","updated_at":"2017-05-26T02:01:30Z","pushed_at":"2018-09-07T03:50:27Z","git_url":"git://github.com/andibateeq/bateeq-module.git","ssh_url":"git@github.com:andibateeq/bateeq-module.git","clone_url":"https://github.com/andibateeq/bateeq-module.git","svn_url":"https://github.com/andibateeq/bateeq-module","homepage":null,"size":1687,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"danliris:dev","ref":"dev","sha":"e4f1563bd4a5074e69633b3db1d27ed284f4d2d7","user":{"login":"danliris","id":20855729,"node_id":"MDQ6VXNlcjIwODU1NzI5","avatar_url":"https://avatars0.githubusercontent.com/u/20855729?v=4","gravatar_id":"","url":"https://api.github.com/users/danliris","html_url":"https://github.com/danliris","followers_url":"https://api.github.com/users/danliris/followers","following_url":"https://api.github.com/users/danliris/following{/other_user}","gists_url":"https://api.github.com/users/danliris/gists{/gist_id}","starred_url":"https://api.github.com/users/danliris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliris/subscriptions","organizations_url":"https://api.github.com/users/danliris/orgs","repos_url":"https://api.github.com/users/danliris/repos","events_url":"https://api.github.com/users/danliris/events{/privacy}","received_events_url":"https://api.github.com/users/danliris/received_events","type":"User","site_admin":false},"repo":{"id":61858352,"node_id":"MDEwOlJlcG9zaXRvcnk2MTg1ODM1Mg==","name":"bateeq-module","full_name":"danliris/bateeq-module","owner":{"login":"danliris","id":20855729,"node_id":"MDQ6VXNlcjIwODU1NzI5","avatar_url":"https://avatars0.githubusercontent.com/u/20855729?v=4","gravatar_id":"","url":"https://api.github.com/users/danliris","html_url":"https://github.com/danliris","followers_url":"https://api.github.com/users/danliris/followers","following_url":"https://api.github.com/users/danliris/following{/other_user}","gists_url":"https://api.github.com/users/danliris/gists{/gist_id}","starred_url":"https://api.github.com/users/danliris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliris/subscriptions","organizations_url":"https://api.github.com/users/danliris/orgs","repos_url":"https://api.github.com/users/danliris/repos","events_url":"https://api.github.com/users/danliris/events{/privacy}","received_events_url":"https://api.github.com/users/danliris/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danliris/bateeq-module","description":"bateeq module","fork":false,"url":"https://api.github.com/repos/danliris/bateeq-module","forks_url":"https://api.github.com/repos/danliris/bateeq-module/forks","keys_url":"https://api.github.com/repos/danliris/bateeq-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danliris/bateeq-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danliris/bateeq-module/teams","hooks_url":"https://api.github.com/repos/danliris/bateeq-module/hooks","issue_events_url":"https://api.github.com/repos/danliris/bateeq-module/issues/events{/number}","events_url":"https://api.github.com/repos/danliris/bateeq-module/events","assignees_url":"https://api.github.com/repos/danliris/bateeq-module/assignees{/user}","branches_url":"https://api.github.com/repos/danliris/bateeq-module/branches{/branch}","tags_url":"https://api.github.com/repos/danliris/bateeq-module/tags","blobs_url":"https://api.github.com/repos/danliris/bateeq-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danliris/bateeq-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danliris/bateeq-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/danliris/bateeq-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danliris/bateeq-module/statuses/{sha}","languages_url":"https://api.github.com/repos/danliris/bateeq-module/languages","stargazers_url":"https://api.github.com/repos/danliris/bateeq-module/stargazers","contributors_url":"https://api.github.com/repos/danliris/bateeq-module/contributors","subscribers_url":"https://api.github.com/repos/danliris/bateeq-module/subscribers","subscription_url":"https://api.github.com/repos/danliris/bateeq-module/subscription","commits_url":"https://api.github.com/repos/danliris/bateeq-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/danliris/bateeq-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/danliris/bateeq-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/danliris/bateeq-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/danliris/bateeq-module/contents/{+path}","compare_url":"https://api.github.com/repos/danliris/bateeq-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danliris/bateeq-module/merges","archive_url":"https://api.github.com/repos/danliris/bateeq-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danliris/bateeq-module/downloads","issues_url":"https://api.github.com/repos/danliris/bateeq-module/issues{/number}","pulls_url":"https://api.github.com/repos/danliris/bateeq-module/pulls{/number}","milestones_url":"https://api.github.com/repos/danliris/bateeq-module/milestones{/number}","notifications_url":"https://api.github.com/repos/danliris/bateeq-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danliris/bateeq-module/labels{/name}","releases_url":"https://api.github.com/repos/danliris/bateeq-module/releases{/id}","deployments_url":"https://api.github.com/repos/danliris/bateeq-module/deployments","created_at":"2016-06-24T05:10:07Z","updated_at":"2018-09-06T16:09:41Z","pushed_at":"2018-09-07T03:51:35Z","git_url":"git://github.com/danliris/bateeq-module.git","ssh_url":"git@github.com:danliris/bateeq-module.git","clone_url":"https://github.com/danliris/bateeq-module.git","svn_url":"https://github.com/danliris/bateeq-module","homepage":null,"size":1785,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":15,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/598"},"html":{"href":"https://github.com/danliris/bateeq-module/pull/598"},"issue":{"href":"https://api.github.com/repos/danliris/bateeq-module/issues/598"},"comments":{"href":"https://api.github.com/repos/danliris/bateeq-module/issues/598/comments"},"review_comments":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/598/comments"},"review_comment":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/598/commits"},"statuses":{"href":"https://api.github.com/repos/danliris/bateeq-module/statuses/9e874fcfe02576ae87045890343ce1225937c333"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}