{"action":"created","comment":{"url":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/comments/233638713","pull_request_review_id":175101981,"id":233638713,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzYzODcxMw==","diff_hunk":"@@ -88,6 +88,42 @@ describe('CLI', () => {\n     expect(() => JSON.parse(data)).not.toThrow();\n   });\n \n+  it('should be able to read template files with a UTF-8 BOM', async () => {\n+    const utf8BOM = Buffer.from([0xEF, 0xBB, 0xBF]);\n+\n+    let files = [\n+      'templates/alertRules.json',\n+      'templates/autoscaleSettings.json',\n+      'templates/servicePlan.json',\n+      'templates/website.json'\n+    ];\n+\n+    let mockFiles = new Map();\n+\n+    for (let file of files) {\n+      let buf = Buffer.concat([utf8BOM, await readFile(file)]);\n+      mockFiles.set(file, buf);\n+    }\n+\n+    let rfn = mockFileRead(mockFiles);\n+    let wfn = mockWriteFile();\n+\n+    let res = await executeCli('templates/*.json', 'merged-template.json');\n+\n+    rfn.mockRestore();\n+\n+    expect(res.exitCode).toBe(0);\n+    expect(res.stderr).toBe('');\n+\n+    expect(wfn).toHaveBeenCalledTimes(1);\n+    let [ outFilename, data ] = wfn.mock.calls[0];\n+\n+    wfn.mockRestore();\n+\n+    expect(outFilename).toBe('merged-template.json');\n+    expect(() => JSON.parse(data)).not.toThrow();","path":"test/cli.test.js","position":37,"original_position":37,"commit_id":"c236f58f51a41ea6580522dba7193d59c4852185","original_commit_id":"c236f58f51a41ea6580522dba7193d59c4852185","user":{"login":"poveden","id":4258778,"node_id":"MDQ6VXNlcjQyNTg3Nzg=","avatar_url":"https://avatars1.githubusercontent.com/u/4258778?v=4","gravatar_id":"","url":"https://api.github.com/users/poveden","html_url":"https://github.com/poveden","followers_url":"https://api.github.com/users/poveden/followers","following_url":"https://api.github.com/users/poveden/following{/other_user}","gists_url":"https://api.github.com/users/poveden/gists{/gist_id}","starred_url":"https://api.github.com/users/poveden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poveden/subscriptions","organizations_url":"https://api.github.com/users/poveden/orgs","repos_url":"https://api.github.com/users/poveden/repos","events_url":"https://api.github.com/users/poveden/events{/privacy}","received_events_url":"https://api.github.com/users/poveden/received_events","type":"User","site_admin":false},"body":"@nulltoken Yes. `JSON.parse()` seems to strictly adhere to the JSON grammar. If, besides whitespace, the parser finds something that is not a quoted string, a number, an array, an object, `true`, `false` or `null`, it will barf (I've tested it).","created_at":"2018-11-14T22:05:42Z","updated_at":"2018-11-14T22:05:43Z","html_url":"https://github.com/axa-group/arm-template-merge/pull/6#discussion_r233638713","pull_request_url":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/6","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/comments/233638713"},"html":{"href":"https://github.com/axa-group/arm-template-merge/pull/6#discussion_r233638713"},"pull_request":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/6"}},"in_reply_to_id":233626155},"pull_request":{"url":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/6","id":229712679,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NzEyNjc5","html_url":"https://github.com/axa-group/arm-template-merge/pull/6","diff_url":"https://github.com/axa-group/arm-template-merge/pull/6.diff","patch_url":"https://github.com/axa-group/arm-template-merge/pull/6.patch","issue_url":"https://api.github.com/repos/axa-group/arm-template-merge/issues/6","number":6,"state":"open","locked":false,"title":"Add stripping of UTF-8 BOM on input files","user":{"login":"poveden","id":4258778,"node_id":"MDQ6VXNlcjQyNTg3Nzg=","avatar_url":"https://avatars1.githubusercontent.com/u/4258778?v=4","gravatar_id":"","url":"https://api.github.com/users/poveden","html_url":"https://github.com/poveden","followers_url":"https://api.github.com/users/poveden/followers","following_url":"https://api.github.com/users/poveden/following{/other_user}","gists_url":"https://api.github.com/users/poveden/gists{/gist_id}","starred_url":"https://api.github.com/users/poveden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poveden/subscriptions","organizations_url":"https://api.github.com/users/poveden/orgs","repos_url":"https://api.github.com/users/poveden/repos","events_url":"https://api.github.com/users/poveden/events{/privacy}","received_events_url":"https://api.github.com/users/poveden/received_events","type":"User","site_admin":false},"body":"## PR Checklist\r\n\r\n- [x] I have run `npm test` locally and all tests are passing.\r\n- [x] I have added/updated tests for any new behavior.\r\n- [x] If this is a significant change, an issue has already been created where the problem / solution was discussed: N/A\r\n\r\n## PR Description\r\n\r\nResolves #4 \r\n","created_at":"2018-11-09T14:36:21Z","updated_at":"2018-11-14T22:05:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2f15cfa320f23fc1d170a9ff4fc26f2ac7073e2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"axarrafols","id":12794186,"node_id":"MDQ6VXNlcjEyNzk0MTg2","avatar_url":"https://avatars3.githubusercontent.com/u/12794186?v=4","gravatar_id":"","url":"https://api.github.com/users/axarrafols","html_url":"https://github.com/axarrafols","followers_url":"https://api.github.com/users/axarrafols/followers","following_url":"https://api.github.com/users/axarrafols/following{/other_user}","gists_url":"https://api.github.com/users/axarrafols/gists{/gist_id}","starred_url":"https://api.github.com/users/axarrafols/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axarrafols/subscriptions","organizations_url":"https://api.github.com/users/axarrafols/orgs","repos_url":"https://api.github.com/users/axarrafols/repos","events_url":"https://api.github.com/users/axarrafols/events{/privacy}","received_events_url":"https://api.github.com/users/axarrafols/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/6/commits","review_comments_url":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/6/comments","review_comment_url":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/axa-group/arm-template-merge/issues/6/comments","statuses_url":"https://api.github.com/repos/axa-group/arm-template-merge/statuses/c236f58f51a41ea6580522dba7193d59c4852185","head":{"label":"axa-group:poveden/utf8-bom","ref":"poveden/utf8-bom","sha":"c236f58f51a41ea6580522dba7193d59c4852185","user":{"login":"axa-group","id":15005905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDA1OTA1","avatar_url":"https://avatars2.githubusercontent.com/u/15005905?v=4","gravatar_id":"","url":"https://api.github.com/users/axa-group","html_url":"https://github.com/axa-group","followers_url":"https://api.github.com/users/axa-group/followers","following_url":"https://api.github.com/users/axa-group/following{/other_user}","gists_url":"https://api.github.com/users/axa-group/gists{/gist_id}","starred_url":"https://api.github.com/users/axa-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axa-group/subscriptions","organizations_url":"https://api.github.com/users/axa-group/orgs","repos_url":"https://api.github.com/users/axa-group/repos","events_url":"https://api.github.com/users/axa-group/events{/privacy}","received_events_url":"https://api.github.com/users/axa-group/received_events","type":"Organization","site_admin":false},"repo":{"id":145085281,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUwODUyODE=","name":"arm-template-merge","full_name":"axa-group/arm-template-merge","private":false,"owner":{"login":"axa-group","id":15005905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDA1OTA1","avatar_url":"https://avatars2.githubusercontent.com/u/15005905?v=4","gravatar_id":"","url":"https://api.github.com/users/axa-group","html_url":"https://github.com/axa-group","followers_url":"https://api.github.com/users/axa-group/followers","following_url":"https://api.github.com/users/axa-group/following{/other_user}","gists_url":"https://api.github.com/users/axa-group/gists{/gist_id}","starred_url":"https://api.github.com/users/axa-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axa-group/subscriptions","organizations_url":"https://api.github.com/users/axa-group/orgs","repos_url":"https://api.github.com/users/axa-group/repos","events_url":"https://api.github.com/users/axa-group/events{/privacy}","received_events_url":"https://api.github.com/users/axa-group/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/axa-group/arm-template-merge","description":"Azure Resource Manager (ARM) templates merging tool","fork":false,"url":"https://api.github.com/repos/axa-group/arm-template-merge","forks_url":"https://api.github.com/repos/axa-group/arm-template-merge/forks","keys_url":"https://api.github.com/repos/axa-group/arm-template-merge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axa-group/arm-template-merge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axa-group/arm-template-merge/teams","hooks_url":"https://api.github.com/repos/axa-group/arm-template-merge/hooks","issue_events_url":"https://api.github.com/repos/axa-group/arm-template-merge/issues/events{/number}","events_url":"https://api.github.com/repos/axa-group/arm-template-merge/events","assignees_url":"https://api.github.com/repos/axa-group/arm-template-merge/assignees{/user}","branches_url":"https://api.github.com/repos/axa-group/arm-template-merge/branches{/branch}","tags_url":"https://api.github.com/repos/axa-group/arm-template-merge/tags","blobs_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/refs{/sha}","trees_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axa-group/arm-template-merge/statuses/{sha}","languages_url":"https://api.github.com/repos/axa-group/arm-template-merge/languages","stargazers_url":"https://api.github.com/repos/axa-group/arm-template-merge/stargazers","contributors_url":"https://api.github.com/repos/axa-group/arm-template-merge/contributors","subscribers_url":"https://api.github.com/repos/axa-group/arm-template-merge/subscribers","subscription_url":"https://api.github.com/repos/axa-group/arm-template-merge/subscription","commits_url":"https://api.github.com/repos/axa-group/arm-template-merge/commits{/sha}","git_commits_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/commits{/sha}","comments_url":"https://api.github.com/repos/axa-group/arm-template-merge/comments{/number}","issue_comment_url":"https://api.github.com/repos/axa-group/arm-template-merge/issues/comments{/number}","contents_url":"https://api.github.com/repos/axa-group/arm-template-merge/contents/{+path}","compare_url":"https://api.github.com/repos/axa-group/arm-template-merge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axa-group/arm-template-merge/merges","archive_url":"https://api.github.com/repos/axa-group/arm-template-merge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axa-group/arm-template-merge/downloads","issues_url":"https://api.github.com/repos/axa-group/arm-template-merge/issues{/number}","pulls_url":"https://api.github.com/repos/axa-group/arm-template-merge/pulls{/number}","milestones_url":"https://api.github.com/repos/axa-group/arm-template-merge/milestones{/number}","notifications_url":"https://api.github.com/repos/axa-group/arm-template-merge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axa-group/arm-template-merge/labels{/name}","releases_url":"https://api.github.com/repos/axa-group/arm-template-merge/releases{/id}","deployments_url":"https://api.github.com/repos/axa-group/arm-template-merge/deployments","created_at":"2018-08-17T07:09:38Z","updated_at":"2018-11-09T13:53:13Z","pushed_at":"2018-11-09T14:36:22Z","git_url":"git://github.com/axa-group/arm-template-merge.git","ssh_url":"git@github.com:axa-group/arm-template-merge.git","clone_url":"https://github.com/axa-group/arm-template-merge.git","svn_url":"https://github.com/axa-group/arm-template-merge","homepage":"","size":91,"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":1,"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":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"axa-group:master","ref":"master","sha":"5f330600738d302cb59fff166bb7929ea2a571c5","user":{"login":"axa-group","id":15005905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDA1OTA1","avatar_url":"https://avatars2.githubusercontent.com/u/15005905?v=4","gravatar_id":"","url":"https://api.github.com/users/axa-group","html_url":"https://github.com/axa-group","followers_url":"https://api.github.com/users/axa-group/followers","following_url":"https://api.github.com/users/axa-group/following{/other_user}","gists_url":"https://api.github.com/users/axa-group/gists{/gist_id}","starred_url":"https://api.github.com/users/axa-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axa-group/subscriptions","organizations_url":"https://api.github.com/users/axa-group/orgs","repos_url":"https://api.github.com/users/axa-group/repos","events_url":"https://api.github.com/users/axa-group/events{/privacy}","received_events_url":"https://api.github.com/users/axa-group/received_events","type":"Organization","site_admin":false},"repo":{"id":145085281,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUwODUyODE=","name":"arm-template-merge","full_name":"axa-group/arm-template-merge","private":false,"owner":{"login":"axa-group","id":15005905,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDA1OTA1","avatar_url":"https://avatars2.githubusercontent.com/u/15005905?v=4","gravatar_id":"","url":"https://api.github.com/users/axa-group","html_url":"https://github.com/axa-group","followers_url":"https://api.github.com/users/axa-group/followers","following_url":"https://api.github.com/users/axa-group/following{/other_user}","gists_url":"https://api.github.com/users/axa-group/gists{/gist_id}","starred_url":"https://api.github.com/users/axa-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axa-group/subscriptions","organizations_url":"https://api.github.com/users/axa-group/orgs","repos_url":"https://api.github.com/users/axa-group/repos","events_url":"https://api.github.com/users/axa-group/events{/privacy}","received_events_url":"https://api.github.com/users/axa-group/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/axa-group/arm-template-merge","description":"Azure Resource Manager (ARM) templates merging tool","fork":false,"url":"https://api.github.com/repos/axa-group/arm-template-merge","forks_url":"https://api.github.com/repos/axa-group/arm-template-merge/forks","keys_url":"https://api.github.com/repos/axa-group/arm-template-merge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axa-group/arm-template-merge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axa-group/arm-template-merge/teams","hooks_url":"https://api.github.com/repos/axa-group/arm-template-merge/hooks","issue_events_url":"https://api.github.com/repos/axa-group/arm-template-merge/issues/events{/number}","events_url":"https://api.github.com/repos/axa-group/arm-template-merge/events","assignees_url":"https://api.github.com/repos/axa-group/arm-template-merge/assignees{/user}","branches_url":"https://api.github.com/repos/axa-group/arm-template-merge/branches{/branch}","tags_url":"https://api.github.com/repos/axa-group/arm-template-merge/tags","blobs_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/refs{/sha}","trees_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axa-group/arm-template-merge/statuses/{sha}","languages_url":"https://api.github.com/repos/axa-group/arm-template-merge/languages","stargazers_url":"https://api.github.com/repos/axa-group/arm-template-merge/stargazers","contributors_url":"https://api.github.com/repos/axa-group/arm-template-merge/contributors","subscribers_url":"https://api.github.com/repos/axa-group/arm-template-merge/subscribers","subscription_url":"https://api.github.com/repos/axa-group/arm-template-merge/subscription","commits_url":"https://api.github.com/repos/axa-group/arm-template-merge/commits{/sha}","git_commits_url":"https://api.github.com/repos/axa-group/arm-template-merge/git/commits{/sha}","comments_url":"https://api.github.com/repos/axa-group/arm-template-merge/comments{/number}","issue_comment_url":"https://api.github.com/repos/axa-group/arm-template-merge/issues/comments{/number}","contents_url":"https://api.github.com/repos/axa-group/arm-template-merge/contents/{+path}","compare_url":"https://api.github.com/repos/axa-group/arm-template-merge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axa-group/arm-template-merge/merges","archive_url":"https://api.github.com/repos/axa-group/arm-template-merge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axa-group/arm-template-merge/downloads","issues_url":"https://api.github.com/repos/axa-group/arm-template-merge/issues{/number}","pulls_url":"https://api.github.com/repos/axa-group/arm-template-merge/pulls{/number}","milestones_url":"https://api.github.com/repos/axa-group/arm-template-merge/milestones{/number}","notifications_url":"https://api.github.com/repos/axa-group/arm-template-merge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axa-group/arm-template-merge/labels{/name}","releases_url":"https://api.github.com/repos/axa-group/arm-template-merge/releases{/id}","deployments_url":"https://api.github.com/repos/axa-group/arm-template-merge/deployments","created_at":"2018-08-17T07:09:38Z","updated_at":"2018-11-09T13:53:13Z","pushed_at":"2018-11-09T14:36:22Z","git_url":"git://github.com/axa-group/arm-template-merge.git","ssh_url":"git@github.com:axa-group/arm-template-merge.git","clone_url":"https://github.com/axa-group/arm-template-merge.git","svn_url":"https://github.com/axa-group/arm-template-merge","homepage":"","size":91,"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":1,"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":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/6"},"html":{"href":"https://github.com/axa-group/arm-template-merge/pull/6"},"issue":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/issues/6"},"comments":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/axa-group/arm-template-merge/statuses/c236f58f51a41ea6580522dba7193d59c4852185"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"poveden"}}