{"action":"closed","issue":{"url":"https://api.github.com/repos/wallabyjs/public/issues/406","labels_url":"https://api.github.com/repos/wallabyjs/public/issues/406/labels{/name}","comments_url":"https://api.github.com/repos/wallabyjs/public/issues/406/comments","events_url":"https://api.github.com/repos/wallabyjs/public/issues/406/events","html_url":"https://github.com/wallabyjs/public/issues/406","id":127126106,"number":406,"title":"Wallaby not executing tests containing angular inject / injectAsync usage.","user":{"login":"areel","id":573567,"avatar_url":"https://avatars.githubusercontent.com/u/573567?v=3","gravatar_id":"","url":"https://api.github.com/users/areel","html_url":"https://github.com/areel","followers_url":"https://api.github.com/users/areel/followers","following_url":"https://api.github.com/users/areel/following{/other_user}","gists_url":"https://api.github.com/users/areel/gists{/gist_id}","starred_url":"https://api.github.com/users/areel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/areel/subscriptions","organizations_url":"https://api.github.com/users/areel/orgs","repos_url":"https://api.github.com/users/areel/repos","events_url":"https://api.github.com/users/areel/events{/privacy}","received_events_url":"https://api.github.com/users/areel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-17T21:42:08Z","updated_at":"2016-01-18T09:47:50Z","closed_at":"2016-01-18T09:47:50Z","body":"Not sure if this is purely a Wallaby issue, or an issue with zone.js.\r\n\r\nI have a working Wallaby environment set up involving jspm, angular2, typescript. With Atom and atom-typescript plugin.\r\nHowever I am having issues with I include use of Angular's **inject** and **injectAsync**\r\n\r\n```\r\nimport {\r\niit,\r\nit,\r\nddescribe,\r\ndescribe,\r\nexpect,\r\ninject,\r\ninjectAsync,\r\nTestComponentBuilder,\r\nbeforeEachProviders\r\n} from 'angular2/testing';\r\n\r\nimport {Component} from 'angular2/core';\r\n\r\ndescribe('simple tests', () => {\r\n  // this test executes fine\r\n  it('should succeed', () => {\r\n      expect(true).toBeTruthy();\r\n  });\r\n\r\n// has issues  \r\n  it('should succeed', injectAsync([TestComponentBuilder], (tcb) => {\r\n    return new Promise((pass, fail) => {\r\n      expect(true).toBeTruthy();\r\n    });\r\n  }));\r\n\r\n  // also has issues\r\n  it('should succeed', inject([TestComponentBuilder], (tcb) => {\r\n      expect(true).toBeTruthy();\r\n  }));\r\n});\r\n\r\n```\r\nLogging has following entries\r\n\r\n```\r\nWallaby Console: Sun, 17 Jan 2016 21:30:12 GMT wallaby:workers Failed to map the stack to user code, entry message: TypeError: 'undefined' is not an object (evaluating 'lang_1.global.zone.fork'), stack: TypeError: 'undefined' is not an object (evaluating 'lang_1.global.zone.fork')\r\nWallaby Console:     at runInTestZone (http://localhost:52459/wallaby_sandbox0.html:44)\r\nWallaby Console:     at http://localhost:52459/wallaby_sandbox0.html:106\r\nWallaby Console: Sun, 17 Jan 2016 21:30:12 GMT wallaby:workers Test executed: should succeed\r\nWallaby Console: Sun, 17 Jan 2016 21:30:12 GMT wallaby:workers Failed to map the stack to user code, entry message: TypeError: 'undefined' is not an object (evaluating 'lang_1.global.zone.fork'), stack: TypeError: 'undefined' is not an object (evaluating 'lang_1.global.zone.fork')\r\nWallaby Console:     at runInTestZone (http://localhost:52459/wallaby_sandbox0.html:44)\r\nWallaby Console:     at http://localhost:52459/wallaby_sandbox0.html:106\r\nWallaby Console: Sun, 17 Jan 2016 21:30:12 GMT wallaby:workers Run 3 test(s), skipped 0 test(s)\r\nWallaby Console: Sun, 17 Jan 2016 21:30:12 GMT wallaby:workers Sandbox [zafxm] is responsive, closing it\r\nWallaby Console: Finished executing 3 affected test(s)\r\n```\r\n\r\nMy config is:\r\n```\r\nmodule.exports = (wallaby) => {\r\n\r\n     return {\r\n       files: [{\r\n         pattern: 'node_modules/phantomjs-polyfill/bind-polyfill.js',\r\n         instrument: false\r\n       }, {\r\n         pattern: 'node_modules/es6-shim/es6-shim.js',\r\n         instrument: false\r\n       }, {\r\n         pattern: 'jspm_packages/system-polyfills.src.js',\r\n         instrument: false\r\n       }, {\r\n         pattern: 'jspm_packages/system.src.js',\r\n         instrument: false\r\n       }, {\r\n         pattern: 'node_modules/reflect-metadata/Reflect.js',\r\n         instrument: false\r\n       }, {\r\n         pattern: 'jspm.config.js',\r\n         instrument: false\r\n       }, {\r\n         pattern: 'app/**/*.ts',\r\n         load: false\r\n       }, {\r\n         pattern: 'app/**/*.html',\r\n         load: false\r\n       }, {\r\n         pattern: 'app/**/*.spec.ts',\r\n         ignore: true\r\n       }, ],\r\n\r\n       tests: [{\r\n         pattern: 'app/tests/*.spec.ts',\r\n         load: false\r\n       }, {\r\n         pattern: 'app/components/**/*.spec.ts',\r\n         load: false\r\n       }, ],\r\n       debug: true,\r\n       compilers: {\r\n         '**/*.ts': wallaby.compilers.typeScript({\r\n           emitDecoratorMetadata: true,\r\n           experimentalDecorators: true,\r\n           module: 4\r\n         })\r\n       },\r\n       // telling wallaby to serve jspm_packages project folder\r\n       // ‘as is’ from the wallaby.js web server\r\n       middleware: (app, express) => {\r\n         app.use('/jspm_packages',\r\n           express.static(\r\n             require('path').join(__dirname, 'jspm_packages')));\r\n       },\r\n\r\n       bootstrap: function(wallaby) {\r\n         wallaby.delayStart();\r\n\r\n         System.config({\r\n           packages: {\r\n             'app': {\r\n               defaultExtension: 'js'\r\n             }\r\n           }\r\n           // `scriptLoad: true` needs to be used for inline error messages,\r\n           // but `scriptLoad: true` for 'app/*' breaks loading html.\r\n           // so somehow `scriptLoad: false` needs to be set for html, not sure how to do it (tried 'app/*.html' - no luck)\r\n           ,\r\n           meta: {\r\n             'app/*spec.js': {\r\n               scriptLoad: true\r\n             }\r\n           }\r\n         });\r\n\r\n         var promises = [];\r\n         for (var i = 0, len = wallaby.tests.length; i < len; i++) {\r\n           promises.push(System['import'](wallaby.tests[i].replace(/\\.js$/, '')));\r\n         }\r\n         Promise.all(promises)\r\n           .then(function() {\r\n             wallaby.start();\r\n           })\r\n           .catch(function(e) {\r\n             setTimeout(function() {\r\n               throw e;\r\n             }, 0);\r\n           });\r\n       }\r\n     };\r\n   };\r\n\r\n\r\n\r\n```"}}