{"action":"created","comment":{"url":"https://api.github.com/repos/n3-charts/line-chart/pulls/comments/34012098","id":34012098,"diff_hunk":"@@ -3,111 +3,209 @@ var gulp   = require('gulp');\n var $ = require('gulp-load-plugins')();\n var runSequence = require('run-sequence');\n var karma = require('karma').server;\n+var protractor = require('gulp-protractor').protractor;\n+var webdriver = require('gulp-protractor').webdriver;\n+var webdriverUpdate = require('gulp-protractor').webdriver_update;\n+\n+var isWatching = false;\n \n var paths = {\n-  e2e: {\n-    from: 'test/e2e/test_cases/**/spec.js'\n-  },\n-  tests: {\n-    from: 'test/**/*.mocha.ts',\n-    to: '.tmp/'\n-  },\n   source: {\n     from: 'src/**/*.ts',\n-    to: 'build/',\n-    to_pattern: 'build/**/*.js'\n+    to: '.tmp/build/',\n+  },\n+  test: {\n+    from: 'test/**/*.ts',\n+    to: '.tmp/test/',\n+  },\n+  spec: {\n+    config: 'test/config/karma.conf.js',\n+    from: 'test/**/*.spec.ts',\n+  },\n+  e2e: {\n+    config: 'test/config/protractor.config.js',\n+    from: 'test/**/*.e2e.ts',\n+  },\n+  coverage: {\n+    to: '.tmp/coverage/',\n   }\n };\n \n-gulp.task('clean:tmp', function () {\n-    return gulp.src(['.tmp/', 'test/coverage/'], {read: false})\n+// Clean the temporary build directory\n+gulp.task('clean:source', function () {\n+    return gulp.src(paths.source.to, {read: false})\n+      .pipe($.clean());\n+});\n+\n+// Clean the temporary test directory\n+gulp.task('clean:test', function () {\n+    return gulp.src(paths.test.to, {read: false})\n       .pipe($.clean());\n });\n \n-gulp.task('clean:build', function () {\n-    return gulp.src(['build/'], {read: false})\n+// Clean the temporary coverage directory\n+gulp.task('clean:coverage', function () {\n+    return gulp.src(paths.coverage.to, {read: false})\n       .pipe($.clean());\n });\n \n-gulp.task('tslint', function () {\n+// Typescript linting the source files\n+gulp.task('ts:lint:source', function () {\n     return gulp.src(paths.source.from)\n       .pipe($.tslint()).pipe($.tslint.report('prose'));\n });\n \n-gulp.task('compile:source', function () {\n+// Typescript linting the test files\n+gulp.task('ts:lint:spec', function () {\n+    return gulp.src(paths.spec.from)\n+      .pipe($.tslint()).pipe($.tslint.report('prose'));\n+});\n+\n+gulp.task('ts:lint:e2e', function () {\n+    return gulp.src(paths.e2e.from)\n+      .pipe($.tslint()).pipe($.tslint.report('prose'));\n+});\n+\n+// Compile the source files to JavaScript\n+gulp.task('ts:compile:source', function () {\n   return gulp\n   .src(paths.source.from)\n   .pipe($.typescript({\n     module: 'CommonJS',\n-    sourcemap: true\n+    out: 'LineChart.js'\n   }))\n   .pipe(gulp.dest(paths.source.to));\n });\n \n-gulp.task('compile:source:concat', function () {\n+// Compile the test files to JavaScript\n+gulp.task('ts:compile:spec', function () {\n   return gulp\n-  .src(paths.source.from)\n+  .src(paths.spec.from)\n   .pipe($.typescript({\n     module: 'CommonJS',\n-    out: 'LineChart.js'\n+    sourcemap: true\n   }))\n-  .pipe(gulp.dest(paths.source.to));\n+  .pipe(gulp.dest(paths.test.to));\n });\n \n-gulp.task('compile:tests', function () {\n+gulp.task('ts:compile:e2e', function () {\n   return gulp\n-  .src(paths.tests.from)\n+  .src(paths.e2e.from)\n   .pipe($.typescript({\n     module: 'CommonJS',\n     sourcemap: true\n   }))\n-  .pipe(gulp.dest(paths.tests.to));\n+  .pipe(gulp.dest(paths.test.to));\n });\n \n-gulp.task('test', ['compile:tests'], function(done) {\n+// Run the unit tests with karma\n+gulp.task('test:spec', ['ts:compile:spec'], function(done) {\n   karma.start({\n-    configFile: __dirname + '/karma.conf.js',\n-    singleRun: true\n+    configFile: __dirname + '/' + paths.spec.config,\n+    singleRun: true,\n+    coverageReporter: {\n+      type: 'lcovonly',\n+      dir: paths.coverage.to\n+    }\n   }, function() {done()});\n });\n \n-gulp.task('e2e', function() {\n-  return gulp.src([\"./test/e2e/test_utils.js\", \"./test/e2e/test_cases/**/spec.js\"])\n-    .pipe($.protractor.protractor({\n-      configFile: \"./test/e2e/protractor.config.js\"\n+// Compile the Jinja test templates\n+gulp.task('jinja:compile:e2e', function() {\n+  // Configure the Nunjucks options\n+  $.nunjucksRender.nunjucks.configure(['test']);\n+  return gulp.src('test/**/*.tpl.html')\n+    .pipe($.nunjucksRender())\n+    .pipe($.rename(function(path) {\n+      pos = path.basename.search('.tpl');\n+      path.basename = path.basename.substring(0, pos);\n     }))\n-    .on('error', function() {})\n+    .pipe(gulp.dest(paths.test.to));\n });\n \n-var watchTasks = ['compile:source:concat', 'test', 'e2e'];\n+// Serve the static files\n+gulp.task('server', $.serve({\n+    root: ['.tmp', 'node_modules'],\n+    port: 1234\n+  })\n+);\n+\n+// Serving files via `gulp serve`\n+gulp.task('serve', function(){\n+  isWatching = true;\n+  gulp.run('server');\n+});\n+\n+// Update webdriver and selenium\n+gulp.task('webdriver', webdriver);\n+gulp.task('webdriver:update', webdriverUpdate);\n+\n+// Run the integration tests with protractor\n+gulp.task('test:e2e', [\n+  'ts:lint:e2e', 'ts:compile:e2e', 'jinja:compile:e2e', 'server'\n+], function() {\n+  return gulp.src(paths.e2e.from)\n+    .pipe(protractor({\n+        configFile: paths.e2e.config,\n+        keepAlive: false,\n+    }))\n+    .on('error', function(err) { throw err; });\n+});\n+\n+// Extensive watch on the source and unit test files\n+var watchTasks = [\n+  'ts:lint:source', 'ts:lint:spec', 'ts:compile:source', 'test:spec'\n+];\n gulp.task('watch', watchTasks, function () {\n-  gulp.watch([paths.tests.from, paths.source.from, paths.e2e.from], [watchTasks])\n+  isWatching = true;\n+  gulp.watch([paths.source.from, paths.test.from], [watchTasks])\n });\n \n-gulp.task('quick-watch', ['compile:source:concat'], function () {\n-  gulp.watch([paths.source.from], [['compile:source:concat']])\n+// Quick watch on the source files\n+gulp.task('quick-watch', ['ts:compile:source'], function () {\n+  isWatching = true;\n+  gulp.watch([paths.source.from], [['ts:compile:source']])\n });\n \n-gulp.task('coveralls', function() {\n-  gulp.src('test/coverage/**/lcov.info')\n+// Submit code coverage to Coveralls\n+gulp.task('coveralls', ['clean:coverage'], function() {\n+  gulp.src(paths.coverage.to + '**/lcov.info')\n     .pipe($.coveralls());\n });\n \n-gulp.task('default', ['build']);\n+// Default task running `gulp`\n+gulp.task('default', function(){","path":"gulpfile.js","position":213,"original_position":213,"commit_id":"117973c06f44a165570d3f4384257c335d3fb07e","original_commit_id":"117973c06f44a165570d3f4384257c335d3fb07e","user":{"login":"chaosmail","id":2969388,"avatar_url":"https://avatars.githubusercontent.com/u/2969388?v=3","gravatar_id":"","url":"https://api.github.com/users/chaosmail","html_url":"https://github.com/chaosmail","followers_url":"https://api.github.com/users/chaosmail/followers","following_url":"https://api.github.com/users/chaosmail/following{/other_user}","gists_url":"https://api.github.com/users/chaosmail/gists{/gist_id}","starred_url":"https://api.github.com/users/chaosmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaosmail/subscriptions","organizations_url":"https://api.github.com/users/chaosmail/orgs","repos_url":"https://api.github.com/users/chaosmail/repos","events_url":"https://api.github.com/users/chaosmail/events{/privacy}","received_events_url":"https://api.github.com/users/chaosmail/received_events","type":"User","site_admin":false},"body":"I had some problems, that the gulp task finished nut didnt exit properly. someone proposed this as a workaround but it didnt change anything. So i better change it back :)","created_at":"2015-07-07T06:57:05Z","updated_at":"2015-07-07T06:57:05Z","html_url":"https://github.com/n3-charts/line-chart/pull/273#discussion_r34012098","pull_request_url":"https://api.github.com/repos/n3-charts/line-chart/pulls/273","_links":{"self":{"href":"https://api.github.com/repos/n3-charts/line-chart/pulls/comments/34012098"},"html":{"href":"https://github.com/n3-charts/line-chart/pull/273#discussion_r34012098"},"pull_request":{"href":"https://api.github.com/repos/n3-charts/line-chart/pulls/273"}}},"pull_request":{"url":"https://api.github.com/repos/n3-charts/line-chart/pulls/273","id":39313447,"html_url":"https://github.com/n3-charts/line-chart/pull/273","diff_url":"https://github.com/n3-charts/line-chart/pull/273.diff","patch_url":"https://github.com/n3-charts/line-chart/pull/273.patch","issue_url":"https://api.github.com/repos/n3-charts/line-chart/issues/273","number":273,"state":"open","locked":false,"title":"Fixed/improved e2e tests","user":{"login":"chaosmail","id":2969388,"avatar_url":"https://avatars.githubusercontent.com/u/2969388?v=3","gravatar_id":"","url":"https://api.github.com/users/chaosmail","html_url":"https://github.com/chaosmail","followers_url":"https://api.github.com/users/chaosmail/followers","following_url":"https://api.github.com/users/chaosmail/following{/other_user}","gists_url":"https://api.github.com/users/chaosmail/gists{/gist_id}","starred_url":"https://api.github.com/users/chaosmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaosmail/subscriptions","organizations_url":"https://api.github.com/users/chaosmail/orgs","repos_url":"https://api.github.com/users/chaosmail/repos","events_url":"https://api.github.com/users/chaosmail/events{/privacy}","received_events_url":"https://api.github.com/users/chaosmail/received_events","type":"User","site_admin":false},"body":"Ok, pretty much what we discussed today. Let me know what you think!","created_at":"2015-07-06T21:36:16Z","updated_at":"2015-07-07T06:57:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58cb7233bbafee97aa417102f0021e83178c9492","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/n3-charts/line-chart/pulls/273/commits","review_comments_url":"https://api.github.com/repos/n3-charts/line-chart/pulls/273/comments","review_comment_url":"https://api.github.com/repos/n3-charts/line-chart/pulls/comments{/number}","comments_url":"https://api.github.com/repos/n3-charts/line-chart/issues/273/comments","statuses_url":"https://api.github.com/repos/n3-charts/line-chart/statuses/117973c06f44a165570d3f4384257c335d3fb07e","head":{"label":"chaosmail:fix/e2e","ref":"fix/e2e","sha":"117973c06f44a165570d3f4384257c335d3fb07e","user":{"login":"chaosmail","id":2969388,"avatar_url":"https://avatars.githubusercontent.com/u/2969388?v=3","gravatar_id":"","url":"https://api.github.com/users/chaosmail","html_url":"https://github.com/chaosmail","followers_url":"https://api.github.com/users/chaosmail/followers","following_url":"https://api.github.com/users/chaosmail/following{/other_user}","gists_url":"https://api.github.com/users/chaosmail/gists{/gist_id}","starred_url":"https://api.github.com/users/chaosmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaosmail/subscriptions","organizations_url":"https://api.github.com/users/chaosmail/orgs","repos_url":"https://api.github.com/users/chaosmail/repos","events_url":"https://api.github.com/users/chaosmail/events{/privacy}","received_events_url":"https://api.github.com/users/chaosmail/received_events","type":"User","site_admin":false},"repo":{"id":35663987,"name":"line-chart","full_name":"chaosmail/line-chart","owner":{"login":"chaosmail","id":2969388,"avatar_url":"https://avatars.githubusercontent.com/u/2969388?v=3","gravatar_id":"","url":"https://api.github.com/users/chaosmail","html_url":"https://github.com/chaosmail","followers_url":"https://api.github.com/users/chaosmail/followers","following_url":"https://api.github.com/users/chaosmail/following{/other_user}","gists_url":"https://api.github.com/users/chaosmail/gists{/gist_id}","starred_url":"https://api.github.com/users/chaosmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaosmail/subscriptions","organizations_url":"https://api.github.com/users/chaosmail/orgs","repos_url":"https://api.github.com/users/chaosmail/repos","events_url":"https://api.github.com/users/chaosmail/events{/privacy}","received_events_url":"https://api.github.com/users/chaosmail/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chaosmail/line-chart","description":"Awesome charts for AngularJS.","fork":true,"url":"https://api.github.com/repos/chaosmail/line-chart","forks_url":"https://api.github.com/repos/chaosmail/line-chart/forks","keys_url":"https://api.github.com/repos/chaosmail/line-chart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chaosmail/line-chart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chaosmail/line-chart/teams","hooks_url":"https://api.github.com/repos/chaosmail/line-chart/hooks","issue_events_url":"https://api.github.com/repos/chaosmail/line-chart/issues/events{/number}","events_url":"https://api.github.com/repos/chaosmail/line-chart/events","assignees_url":"https://api.github.com/repos/chaosmail/line-chart/assignees{/user}","branches_url":"https://api.github.com/repos/chaosmail/line-chart/branches{/branch}","tags_url":"https://api.github.com/repos/chaosmail/line-chart/tags","blobs_url":"https://api.github.com/repos/chaosmail/line-chart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chaosmail/line-chart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chaosmail/line-chart/git/refs{/sha}","trees_url":"https://api.github.com/repos/chaosmail/line-chart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chaosmail/line-chart/statuses/{sha}","languages_url":"https://api.github.com/repos/chaosmail/line-chart/languages","stargazers_url":"https://api.github.com/repos/chaosmail/line-chart/stargazers","contributors_url":"https://api.github.com/repos/chaosmail/line-chart/contributors","subscribers_url":"https://api.github.com/repos/chaosmail/line-chart/subscribers","subscription_url":"https://api.github.com/repos/chaosmail/line-chart/subscription","commits_url":"https://api.github.com/repos/chaosmail/line-chart/commits{/sha}","git_commits_url":"https://api.github.com/repos/chaosmail/line-chart/git/commits{/sha}","comments_url":"https://api.github.com/repos/chaosmail/line-chart/comments{/number}","issue_comment_url":"https://api.github.com/repos/chaosmail/line-chart/issues/comments{/number}","contents_url":"https://api.github.com/repos/chaosmail/line-chart/contents/{+path}","compare_url":"https://api.github.com/repos/chaosmail/line-chart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chaosmail/line-chart/merges","archive_url":"https://api.github.com/repos/chaosmail/line-chart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chaosmail/line-chart/downloads","issues_url":"https://api.github.com/repos/chaosmail/line-chart/issues{/number}","pulls_url":"https://api.github.com/repos/chaosmail/line-chart/pulls{/number}","milestones_url":"https://api.github.com/repos/chaosmail/line-chart/milestones{/number}","notifications_url":"https://api.github.com/repos/chaosmail/line-chart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chaosmail/line-chart/labels{/name}","releases_url":"https://api.github.com/repos/chaosmail/line-chart/releases{/id}","created_at":"2015-05-15T08:54:23Z","updated_at":"2015-05-15T08:54:24Z","pushed_at":"2015-07-06T22:21:01Z","git_url":"git://github.com/chaosmail/line-chart.git","ssh_url":"git@github.com:chaosmail/line-chart.git","clone_url":"https://github.com/chaosmail/line-chart.git","svn_url":"https://github.com/chaosmail/line-chart","homepage":"http://n3-charts.github.io/line-chart/","size":12462,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"n3-charts:dev","ref":"dev","sha":"ac1d0d02972f7c80d066f86950fd88726b109e48","user":{"login":"n3-charts","id":4318902,"avatar_url":"https://avatars.githubusercontent.com/u/4318902?v=3","gravatar_id":"","url":"https://api.github.com/users/n3-charts","html_url":"https://github.com/n3-charts","followers_url":"https://api.github.com/users/n3-charts/followers","following_url":"https://api.github.com/users/n3-charts/following{/other_user}","gists_url":"https://api.github.com/users/n3-charts/gists{/gist_id}","starred_url":"https://api.github.com/users/n3-charts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3-charts/subscriptions","organizations_url":"https://api.github.com/users/n3-charts/orgs","repos_url":"https://api.github.com/users/n3-charts/repos","events_url":"https://api.github.com/users/n3-charts/events{/privacy}","received_events_url":"https://api.github.com/users/n3-charts/received_events","type":"Organization","site_admin":false},"repo":{"id":9873034,"name":"line-chart","full_name":"n3-charts/line-chart","owner":{"login":"n3-charts","id":4318902,"avatar_url":"https://avatars.githubusercontent.com/u/4318902?v=3","gravatar_id":"","url":"https://api.github.com/users/n3-charts","html_url":"https://github.com/n3-charts","followers_url":"https://api.github.com/users/n3-charts/followers","following_url":"https://api.github.com/users/n3-charts/following{/other_user}","gists_url":"https://api.github.com/users/n3-charts/gists{/gist_id}","starred_url":"https://api.github.com/users/n3-charts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3-charts/subscriptions","organizations_url":"https://api.github.com/users/n3-charts/orgs","repos_url":"https://api.github.com/users/n3-charts/repos","events_url":"https://api.github.com/users/n3-charts/events{/privacy}","received_events_url":"https://api.github.com/users/n3-charts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/n3-charts/line-chart","description":"Awesome charts for AngularJS.","fork":false,"url":"https://api.github.com/repos/n3-charts/line-chart","forks_url":"https://api.github.com/repos/n3-charts/line-chart/forks","keys_url":"https://api.github.com/repos/n3-charts/line-chart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/n3-charts/line-chart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/n3-charts/line-chart/teams","hooks_url":"https://api.github.com/repos/n3-charts/line-chart/hooks","issue_events_url":"https://api.github.com/repos/n3-charts/line-chart/issues/events{/number}","events_url":"https://api.github.com/repos/n3-charts/line-chart/events","assignees_url":"https://api.github.com/repos/n3-charts/line-chart/assignees{/user}","branches_url":"https://api.github.com/repos/n3-charts/line-chart/branches{/branch}","tags_url":"https://api.github.com/repos/n3-charts/line-chart/tags","blobs_url":"https://api.github.com/repos/n3-charts/line-chart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/n3-charts/line-chart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/n3-charts/line-chart/git/refs{/sha}","trees_url":"https://api.github.com/repos/n3-charts/line-chart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/n3-charts/line-chart/statuses/{sha}","languages_url":"https://api.github.com/repos/n3-charts/line-chart/languages","stargazers_url":"https://api.github.com/repos/n3-charts/line-chart/stargazers","contributors_url":"https://api.github.com/repos/n3-charts/line-chart/contributors","subscribers_url":"https://api.github.com/repos/n3-charts/line-chart/subscribers","subscription_url":"https://api.github.com/repos/n3-charts/line-chart/subscription","commits_url":"https://api.github.com/repos/n3-charts/line-chart/commits{/sha}","git_commits_url":"https://api.github.com/repos/n3-charts/line-chart/git/commits{/sha}","comments_url":"https://api.github.com/repos/n3-charts/line-chart/comments{/number}","issue_comment_url":"https://api.github.com/repos/n3-charts/line-chart/issues/comments{/number}","contents_url":"https://api.github.com/repos/n3-charts/line-chart/contents/{+path}","compare_url":"https://api.github.com/repos/n3-charts/line-chart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/n3-charts/line-chart/merges","archive_url":"https://api.github.com/repos/n3-charts/line-chart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/n3-charts/line-chart/downloads","issues_url":"https://api.github.com/repos/n3-charts/line-chart/issues{/number}","pulls_url":"https://api.github.com/repos/n3-charts/line-chart/pulls{/number}","milestones_url":"https://api.github.com/repos/n3-charts/line-chart/milestones{/number}","notifications_url":"https://api.github.com/repos/n3-charts/line-chart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/n3-charts/line-chart/labels{/name}","releases_url":"https://api.github.com/repos/n3-charts/line-chart/releases{/id}","created_at":"2013-05-05T19:01:04Z","updated_at":"2015-07-06T07:28:42Z","pushed_at":"2015-07-06T22:21:02Z","git_url":"git://github.com/n3-charts/line-chart.git","ssh_url":"git@github.com:n3-charts/line-chart.git","clone_url":"https://github.com/n3-charts/line-chart.git","svn_url":"https://github.com/n3-charts/line-chart","homepage":"http://n3-charts.github.io/line-chart/","size":14634,"stargazers_count":931,"watchers_count":931,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":129,"mirror_url":null,"open_issues_count":29,"forks":129,"open_issues":29,"watchers":931,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/n3-charts/line-chart/pulls/273"},"html":{"href":"https://github.com/n3-charts/line-chart/pull/273"},"issue":{"href":"https://api.github.com/repos/n3-charts/line-chart/issues/273"},"comments":{"href":"https://api.github.com/repos/n3-charts/line-chart/issues/273/comments"},"review_comments":{"href":"https://api.github.com/repos/n3-charts/line-chart/pulls/273/comments"},"review_comment":{"href":"https://api.github.com/repos/n3-charts/line-chart/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/n3-charts/line-chart/pulls/273/commits"},"statuses":{"href":"https://api.github.com/repos/n3-charts/line-chart/statuses/117973c06f44a165570d3f4384257c335d3fb07e"}}}}