{"action":"created","comment":{"url":"https://api.github.com/repos/wix/angular-widget/pulls/comments/35489970","id":35489970,"diff_hunk":"@@ -0,0 +1,128 @@\n+'use strict';\n+\n+describe('Service: sequentialFileLoader', function () {\n+\n+  // load the service's module\n+  beforeEach(function () {\n+    module('angularWidgetInternal');\n+    module({\n+      tagAppender: jasmine.createSpy('tagAppender')\n+    });\n+  });\n+\n+  // instantiate service\n+  var sequentialFileLoader, $rootScope, $q;\n+  beforeEach(inject(function (_sequentialFileLoader_, _$rootScope_, _$q_) {\n+    sequentialFileLoader = _sequentialFileLoader_;\n+    $rootScope = _$rootScope_;\n+    $q = _$q_;\n+  }));\n+\n+  function byFileName(filename) {\n+    return function (file) {\n+      return file.filename === filename;\n+    };\n+  }\n+\n+  function toFilePromise(file) {\n+    return file.defer.promise;\n+  }\n+\n+  function toFileObj(filename) {\n+    return {\n+      filename: filename,\n+      ext: filename.split('.').reverse()[0],\n+      defer: $q.defer()\n+    };\n+  }\n+\n+  function toFileName(file) {\n+     return file.filename;\n+   }\n+\n+  function setupTagAppender(files) {\n+    inject(function (tagAppender) {\n+      tagAppender.andCallFake(function (filename) {\n+        return files.filter(byFileName(filename)).map(toFilePromise)[0];\n+      });\n+    });\n+  }\n+\n+  function expectCallOnlyFor(file) {\n+    inject(function (tagAppender) {\n+      expect(tagAppender).toHaveBeenCalledWith(file.filename, file.filename.split('.').reverse()[0]);\n+      expect(tagAppender.callCount).toBe(1);\n+      tagAppender.reset();\n+    });\n+  }\n+\n+  function testForFile(file, isResolvedFn) {\n+    expectCallOnlyFor(file);\n+    expect(isResolvedFn()).toBe(false);\n+    file.defer.resolve();\n+    $rootScope.$digest();\n+  }\n+\n+  function runSequentialTests(files, isResolvedFn) {\n+    inject(function (tagAppender) {\n+      $rootScope.$digest();\n+\n+      files.forEach(function (file) {\n+        testForFile(file, isResolvedFn);\n+      });\n+\n+      expect(tagAppender.callCount).toBe(0);\n+    });\n+  }\n+\n+  it('should load files sequentially', function () {","path":"test/spec/services/sequential-file-loader.spec.js","position":78,"original_position":78,"commit_id":"89e931f38b560589c98d8e4a3a09a5829765f898","original_commit_id":"89e931f38b560589c98d8e4a3a09a5829765f898","user":{"login":"shahata","id":1764161,"avatar_url":"https://avatars.githubusercontent.com/u/1764161?v=3","gravatar_id":"","url":"https://api.github.com/users/shahata","html_url":"https://github.com/shahata","followers_url":"https://api.github.com/users/shahata/followers","following_url":"https://api.github.com/users/shahata/following{/other_user}","gists_url":"https://api.github.com/users/shahata/gists{/gist_id}","starred_url":"https://api.github.com/users/shahata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shahata/subscriptions","organizations_url":"https://api.github.com/users/shahata/orgs","repos_url":"https://api.github.com/users/shahata/repos","events_url":"https://api.github.com/users/shahata/events{/privacy}","received_events_url":"https://api.github.com/users/shahata/received_events","type":"User","site_admin":false},"body":"where in this test are you testing that anything happens sequentially?","created_at":"2015-07-26T07:00:22Z","updated_at":"2015-07-26T07:00:22Z","html_url":"https://github.com/wix/angular-widget/pull/16#discussion_r35489970","pull_request_url":"https://api.github.com/repos/wix/angular-widget/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/wix/angular-widget/pulls/comments/35489970"},"html":{"href":"https://github.com/wix/angular-widget/pull/16#discussion_r35489970"},"pull_request":{"href":"https://api.github.com/repos/wix/angular-widget/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/wix/angular-widget/pulls/16","id":40848765,"html_url":"https://github.com/wix/angular-widget/pull/16","diff_url":"https://github.com/wix/angular-widget/pull/16.diff","patch_url":"https://github.com/wix/angular-widget/pull/16.patch","issue_url":"https://api.github.com/repos/wix/angular-widget/issues/16","number":16,"state":"open","locked":false,"title":"feat(tag-appender): Enable loading scripts in a specific order with a…","user":{"login":"hesher","id":159887,"avatar_url":"https://avatars.githubusercontent.com/u/159887?v=3","gravatar_id":"","url":"https://api.github.com/users/hesher","html_url":"https://github.com/hesher","followers_url":"https://api.github.com/users/hesher/followers","following_url":"https://api.github.com/users/hesher/following{/other_user}","gists_url":"https://api.github.com/users/hesher/gists{/gist_id}","starred_url":"https://api.github.com/users/hesher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hesher/subscriptions","organizations_url":"https://api.github.com/users/hesher/orgs","repos_url":"https://api.github.com/users/hesher/repos","events_url":"https://api.github.com/users/hesher/events{/privacy}","received_events_url":"https://api.github.com/users/hesher/received_events","type":"User","site_admin":false},"body":"… flag in angular-widget","created_at":"2015-07-26T06:21:22Z","updated_at":"2015-07-26T07:00:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6911a65008df98e8ad16ba315094354bc3708cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wix/angular-widget/pulls/16/commits","review_comments_url":"https://api.github.com/repos/wix/angular-widget/pulls/16/comments","review_comment_url":"https://api.github.com/repos/wix/angular-widget/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wix/angular-widget/issues/16/comments","statuses_url":"https://api.github.com/repos/wix/angular-widget/statuses/89e931f38b560589c98d8e4a3a09a5829765f898","head":{"label":"hesher:serialize-script-load","ref":"serialize-script-load","sha":"89e931f38b560589c98d8e4a3a09a5829765f898","user":{"login":"hesher","id":159887,"avatar_url":"https://avatars.githubusercontent.com/u/159887?v=3","gravatar_id":"","url":"https://api.github.com/users/hesher","html_url":"https://github.com/hesher","followers_url":"https://api.github.com/users/hesher/followers","following_url":"https://api.github.com/users/hesher/following{/other_user}","gists_url":"https://api.github.com/users/hesher/gists{/gist_id}","starred_url":"https://api.github.com/users/hesher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hesher/subscriptions","organizations_url":"https://api.github.com/users/hesher/orgs","repos_url":"https://api.github.com/users/hesher/repos","events_url":"https://api.github.com/users/hesher/events{/privacy}","received_events_url":"https://api.github.com/users/hesher/received_events","type":"User","site_admin":false},"repo":{"id":39494573,"name":"angular-widget","full_name":"hesher/angular-widget","owner":{"login":"hesher","id":159887,"avatar_url":"https://avatars.githubusercontent.com/u/159887?v=3","gravatar_id":"","url":"https://api.github.com/users/hesher","html_url":"https://github.com/hesher","followers_url":"https://api.github.com/users/hesher/followers","following_url":"https://api.github.com/users/hesher/following{/other_user}","gists_url":"https://api.github.com/users/hesher/gists{/gist_id}","starred_url":"https://api.github.com/users/hesher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hesher/subscriptions","organizations_url":"https://api.github.com/users/hesher/orgs","repos_url":"https://api.github.com/users/hesher/repos","events_url":"https://api.github.com/users/hesher/events{/privacy}","received_events_url":"https://api.github.com/users/hesher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hesher/angular-widget","description":"Lazy load isolated micro-apps in Angular","fork":true,"url":"https://api.github.com/repos/hesher/angular-widget","forks_url":"https://api.github.com/repos/hesher/angular-widget/forks","keys_url":"https://api.github.com/repos/hesher/angular-widget/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hesher/angular-widget/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hesher/angular-widget/teams","hooks_url":"https://api.github.com/repos/hesher/angular-widget/hooks","issue_events_url":"https://api.github.com/repos/hesher/angular-widget/issues/events{/number}","events_url":"https://api.github.com/repos/hesher/angular-widget/events","assignees_url":"https://api.github.com/repos/hesher/angular-widget/assignees{/user}","branches_url":"https://api.github.com/repos/hesher/angular-widget/branches{/branch}","tags_url":"https://api.github.com/repos/hesher/angular-widget/tags","blobs_url":"https://api.github.com/repos/hesher/angular-widget/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hesher/angular-widget/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hesher/angular-widget/git/refs{/sha}","trees_url":"https://api.github.com/repos/hesher/angular-widget/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hesher/angular-widget/statuses/{sha}","languages_url":"https://api.github.com/repos/hesher/angular-widget/languages","stargazers_url":"https://api.github.com/repos/hesher/angular-widget/stargazers","contributors_url":"https://api.github.com/repos/hesher/angular-widget/contributors","subscribers_url":"https://api.github.com/repos/hesher/angular-widget/subscribers","subscription_url":"https://api.github.com/repos/hesher/angular-widget/subscription","commits_url":"https://api.github.com/repos/hesher/angular-widget/commits{/sha}","git_commits_url":"https://api.github.com/repos/hesher/angular-widget/git/commits{/sha}","comments_url":"https://api.github.com/repos/hesher/angular-widget/comments{/number}","issue_comment_url":"https://api.github.com/repos/hesher/angular-widget/issues/comments{/number}","contents_url":"https://api.github.com/repos/hesher/angular-widget/contents/{+path}","compare_url":"https://api.github.com/repos/hesher/angular-widget/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hesher/angular-widget/merges","archive_url":"https://api.github.com/repos/hesher/angular-widget/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hesher/angular-widget/downloads","issues_url":"https://api.github.com/repos/hesher/angular-widget/issues{/number}","pulls_url":"https://api.github.com/repos/hesher/angular-widget/pulls{/number}","milestones_url":"https://api.github.com/repos/hesher/angular-widget/milestones{/number}","notifications_url":"https://api.github.com/repos/hesher/angular-widget/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hesher/angular-widget/labels{/name}","releases_url":"https://api.github.com/repos/hesher/angular-widget/releases{/id}","created_at":"2015-07-22T08:26:18Z","updated_at":"2015-07-22T08:26:19Z","pushed_at":"2015-07-26T06:20:41Z","git_url":"git://github.com/hesher/angular-widget.git","ssh_url":"git@github.com:hesher/angular-widget.git","clone_url":"https://github.com/hesher/angular-widget.git","svn_url":"https://github.com/hesher/angular-widget","homepage":"http://shahata.github.io/angular-widget/","size":1136,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"wix:master","ref":"master","sha":"1174c66e2676f854b5c0ac9e91ce771073f902b5","user":{"login":"wix","id":686511,"avatar_url":"https://avatars.githubusercontent.com/u/686511?v=3","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"repo":{"id":20110956,"name":"angular-widget","full_name":"wix/angular-widget","owner":{"login":"wix","id":686511,"avatar_url":"https://avatars.githubusercontent.com/u/686511?v=3","gravatar_id":"","url":"https://api.github.com/users/wix","html_url":"https://github.com/wix","followers_url":"https://api.github.com/users/wix/followers","following_url":"https://api.github.com/users/wix/following{/other_user}","gists_url":"https://api.github.com/users/wix/gists{/gist_id}","starred_url":"https://api.github.com/users/wix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wix/subscriptions","organizations_url":"https://api.github.com/users/wix/orgs","repos_url":"https://api.github.com/users/wix/repos","events_url":"https://api.github.com/users/wix/events{/privacy}","received_events_url":"https://api.github.com/users/wix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wix/angular-widget","description":"Lazy load isolated micro-apps in Angular","fork":false,"url":"https://api.github.com/repos/wix/angular-widget","forks_url":"https://api.github.com/repos/wix/angular-widget/forks","keys_url":"https://api.github.com/repos/wix/angular-widget/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wix/angular-widget/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wix/angular-widget/teams","hooks_url":"https://api.github.com/repos/wix/angular-widget/hooks","issue_events_url":"https://api.github.com/repos/wix/angular-widget/issues/events{/number}","events_url":"https://api.github.com/repos/wix/angular-widget/events","assignees_url":"https://api.github.com/repos/wix/angular-widget/assignees{/user}","branches_url":"https://api.github.com/repos/wix/angular-widget/branches{/branch}","tags_url":"https://api.github.com/repos/wix/angular-widget/tags","blobs_url":"https://api.github.com/repos/wix/angular-widget/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wix/angular-widget/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wix/angular-widget/git/refs{/sha}","trees_url":"https://api.github.com/repos/wix/angular-widget/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wix/angular-widget/statuses/{sha}","languages_url":"https://api.github.com/repos/wix/angular-widget/languages","stargazers_url":"https://api.github.com/repos/wix/angular-widget/stargazers","contributors_url":"https://api.github.com/repos/wix/angular-widget/contributors","subscribers_url":"https://api.github.com/repos/wix/angular-widget/subscribers","subscription_url":"https://api.github.com/repos/wix/angular-widget/subscription","commits_url":"https://api.github.com/repos/wix/angular-widget/commits{/sha}","git_commits_url":"https://api.github.com/repos/wix/angular-widget/git/commits{/sha}","comments_url":"https://api.github.com/repos/wix/angular-widget/comments{/number}","issue_comment_url":"https://api.github.com/repos/wix/angular-widget/issues/comments{/number}","contents_url":"https://api.github.com/repos/wix/angular-widget/contents/{+path}","compare_url":"https://api.github.com/repos/wix/angular-widget/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wix/angular-widget/merges","archive_url":"https://api.github.com/repos/wix/angular-widget/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wix/angular-widget/downloads","issues_url":"https://api.github.com/repos/wix/angular-widget/issues{/number}","pulls_url":"https://api.github.com/repos/wix/angular-widget/pulls{/number}","milestones_url":"https://api.github.com/repos/wix/angular-widget/milestones{/number}","notifications_url":"https://api.github.com/repos/wix/angular-widget/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wix/angular-widget/labels{/name}","releases_url":"https://api.github.com/repos/wix/angular-widget/releases{/id}","created_at":"2014-05-23T19:07:13Z","updated_at":"2015-07-22T22:42:39Z","pushed_at":"2015-07-26T06:21:22Z","git_url":"git://github.com/wix/angular-widget.git","ssh_url":"git@github.com:wix/angular-widget.git","clone_url":"https://github.com/wix/angular-widget.git","svn_url":"https://github.com/wix/angular-widget","homepage":"http://shahata.github.io/angular-widget/","size":1136,"stargazers_count":76,"watchers_count":76,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":6,"forks":13,"open_issues":6,"watchers":76,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wix/angular-widget/pulls/16"},"html":{"href":"https://github.com/wix/angular-widget/pull/16"},"issue":{"href":"https://api.github.com/repos/wix/angular-widget/issues/16"},"comments":{"href":"https://api.github.com/repos/wix/angular-widget/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/wix/angular-widget/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/wix/angular-widget/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wix/angular-widget/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/wix/angular-widget/statuses/89e931f38b560589c98d8e4a3a09a5829765f898"}}}}