{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/1881","labels_url":"https://api.github.com/repos/angular/angular/issues/1881/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/1881/comments","events_url":"https://api.github.com/repos/angular/angular/issues/1881/events","html_url":"https://github.com/angular/angular/issues/1881","id":76114824,"number":1881,"title":"confusing error while running test.unit.cjs","user":{"login":"mhevery","id":111951,"avatar_url":"https://avatars.githubusercontent.com/u/111951?v=3","gravatar_id":"","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/33","html_url":"https://github.com/angular/angular/milestones/Build%20System","labels_url":"https://api.github.com/repos/angular/angular/milestones/33/labels","id":1109241,"number":33,"title":"Build System","description":null,"creator":{"login":"mhevery","id":111951,"avatar_url":"https://avatars.githubusercontent.com/u/111951?v=3","gravatar_id":"","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":1,"state":"open","created_at":"2015-05-13T20:34:07Z","updated_at":"2015-05-14T00:05:50Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-05-13T20:34:14Z","updated_at":"2015-05-14T05:04:08Z","closed_at":null,"body":"If you have a test which is failing then you get this error.\r\n\r\n```\r\n/Users/misko/.nvm/versions/node/v0.12.2/bin/node /Users/misko/work/angular/node_modules/gulp/bin/gulp.js --color --gulpfile /Users/misko/work/angular/gulpfile.js test.unit.cjs\r\n[13:31:41] Working directory changed to ~/work/angular\r\nDart SDK detected\r\n[13:31:43] Using gulpfile ~/work/angular/gulpfile.js\r\n[13:31:43] Starting 'build/clean.js'...\r\n[13:31:43] Starting 'build/clean.tools'...\r\n[13:31:43] Finished 'build/clean.tools' after 738 μs\r\n[13:31:43] Starting 'build.tools'...\r\n[13:31:43] Starting '!build.tools'...\r\n[13:31:43] Finished 'build/clean.js' after 309 ms\r\n[13:31:45] Finished '!build.tools' after 2.41 s\r\n[13:31:45] Finished 'build.tools' after 2.41 s\r\n[13:31:45] Starting 'test.unit.cjs'...\r\n[13:31:45] Starting '!build.js.cjs'...\r\nTree diff:          funnel-output_path-2kDwRVsn.tmp, duration:    19ms,   273 changes detected (files:   273, directories:  166)\r\nTree diff:          funnel-output_path-2kDwRVsn.tmp, duration:    16ms,    50 changes detected (files:    50, directories:  166)\r\nTree diff:                   funnel-dest_EFW5yV.tmp, duration:    34ms,   729 changes detected (files:   729, directories:   87)\r\n\r\nSlowest Trees                                 | Total               \r\n----------------------------------------------+---------------------\r\nDiffingTSCompiler                             | 23227ms             \r\nDiffingTraceurCompiler                        | 3856ms              \r\n\r\nSlowest Trees (cumulative)                    | Total (avg)         \r\n----------------------------------------------+---------------------\r\nDiffingTSCompiler (1)                         | 23227ms             \r\nDiffingTraceurCompiler (1)                    | 3856ms              \r\n\r\ncreating node_modules symlink hack\r\ncreating link dist/js/cjs/node_modules/angular2 ../angular2\r\ncreating link dist/js/cjs/node_modules/benchmarks ../benchmarks\r\ncreating link dist/js/cjs/node_modules/benchmarks_external ../benchmarks_external\r\ncreating link dist/js/cjs/node_modules/benchpress ../benchpress\r\ncreating link dist/js/cjs/node_modules/examples ../examples\r\ncreating link dist/js/cjs/node_modules/rtts_assert ../rtts_assert\r\n[13:32:13] Finished '!build.js.cjs' after 28 s\r\n[13:32:13] Starting 'test.unit.cjs/ci'...\r\nF\r\n\r\nFailures: \r\n1) injector resolve should resolve forward references\r\n1.1) TypeError: undefined is not a function\r\n    TypeError: undefined is not a function\r\n        at /Users/misko/Dropbox/work/angular/dist/js/cjs/angular2/test/di/injector_spec.js:330:13\r\n        at FunctionWrapper.apply (/Users/misko/Dropbox/work/angular/dist/js/cjs/angular2/src/facade/lang.js:228:64)\r\n        at FunctionWithParamTokens.execute (/Users/misko/Dropbox/work/angular/dist/js/cjs/angular2/src/test_lib/test_injector.js:138:21)\r\n        at Object.<anonymous> (/Users/misko/Dropbox/work/angular/dist/js/cjs/angular2/src/test_lib/test_lib.js:183:8)\r\n\r\n1 spec, 1 failure\r\nFinished in 0.012 seconds\r\n[13:32:14] 'test.unit.cjs/ci' errored after 884 ms\r\n[13:32:14] Error: 1\r\n    at formatError (/Users/misko/Dropbox/work/angular/node_modules/gulp/bin/gulp.js:169:10)\r\n    at Gulp.<anonymous> (/Users/misko/Dropbox/work/angular/node_modules/gulp/bin/gulp.js:195:15)\r\n    at Gulp.emit (events.js:129:20)\r\n    at Gulp.Orchestrator._emitTaskDone (/Users/misko/Dropbox/work/angular/node_modules/gulp/node_modules/orchestrator/index.js:264:8)\r\n    at /Users/misko/Dropbox/work/angular/node_modules/gulp/node_modules/orchestrator/index.js:275:23\r\n    at finish (/Users/misko/Dropbox/work/angular/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)\r\n    at cb (/Users/misko/Dropbox/work/angular/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)\r\n    at ChildProcess.<anonymous> (/Users/misko/Dropbox/work/angular/gulpfile.js:451:5)\r\n    at ChildProcess.emit (events.js:110:17)\r\n    at maybeClose (child_process.js:1015:16)\r\n    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)\r\nError running task sequence: { task: 'test.unit.cjs/ci',\r\n  message: 'test.unit.cjs/ci callback',\r\n  duration: 0.884107958,\r\n  hrDuration: [ 0, 884107958 ],\r\n  err: 1 }\r\n```"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/101913030","html_url":"https://github.com/angular/angular/issues/1881#issuecomment-101913030","issue_url":"https://api.github.com/repos/angular/angular/issues/1881","id":101913030,"user":{"login":"caitp","id":2294695,"avatar_url":"https://avatars.githubusercontent.com/u/2294695?v=3","gravatar_id":"","url":"https://api.github.com/users/caitp","html_url":"https://github.com/caitp","followers_url":"https://api.github.com/users/caitp/followers","following_url":"https://api.github.com/users/caitp/following{/other_user}","gists_url":"https://api.github.com/users/caitp/gists{/gist_id}","starred_url":"https://api.github.com/users/caitp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caitp/subscriptions","organizations_url":"https://api.github.com/users/caitp/orgs","repos_url":"https://api.github.com/users/caitp/repos","events_url":"https://api.github.com/users/caitp/events{/privacy}","received_events_url":"https://api.github.com/users/caitp/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T05:04:08Z","updated_at":"2015-05-14T05:04:08Z","body":"Igor, the simplest fix is to just bind the done callback with a null first argument, or else wrap calling done in a closure. (Right now, the done callback is just used as the close event handler, and gulp eats the non-0 exit code)"}}