我正在使用 karma 和 jasmine 构建一个用于单元测试的 ionic 2 应用程序,但在运行单元测试时突然出现此错误。
有人知道问题出在哪里以及问题出在哪里吗?
马汀
ERROR: 'Unhandled Promise rejection:', 'null is not an object (evaluating 'link.match')', '; Zone:', '<root>', '; Task:', 'Promise.then', '; Value:', TypeError{stack: 'setLink@http://localhost:9876/absolute/var/folders/0h/gf8s5_tj7x7f953vj4yhyp5h0000gp/T/c2e92d78eba2d7ff1999b961b1eb626b.browserify?fa64c4575df6c4e0f466062ff4330eb717508bdc:987:6033
http://localhost:9876/absolute/var/folders/0h/gf8s5_tj7x7f953vj4yhyp5h0000gp/T/c2e92d78eba2d7ff1999b961b1eb626b.browserify?fa64c4575df6c4e0f466062ff4330eb717508bdc:987:3252
invoke@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:323:34
run@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:216:50
http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:571:61
invokeTask@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:356:43
runTask@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:256:58
drainMicroTaskQueue@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:474:43
promiseReactionJob@http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2194:32
http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2182:27
handleMessage@http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2139:15', line: 987, sourceURL: 'http://localhost:9876/absolute/var/folders/0h/gf8s5_tj7x7f953vj4yhyp5h0000gp/T/c2e92d78eba2d7ff1999b961b1eb626b.browserify?fa64c4575df6c4e0f466062ff4330eb717508bdc'}
ERROR: Error{line: 538, sourceURL: 'http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277', stack: 'resolvePromise@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:538:76
http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:574:32
invokeTask@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:356:43
runTask@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:256:58
drainMicroTaskQueue@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:474:43
promiseReactionJob@http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2194:32
http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2182:27
handleMessage@http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2139:15', rejection: TypeError{stack: 'setLink@http://localhost:9876/absolute/var/folders/0h/gf8s5_tj7x7f953vj4yhyp5h0000gp/T/c2e92d78eba2d7ff1999b961b1eb626b.browserify?fa64c4575df6c4e0f466062ff4330eb717508bdc:987:6033
http://localhost:9876/absolute/var/folders/0h/gf8s5_tj7x7f953vj4yhyp5h0000gp/T/c2e92d78eba2d7ff1999b961b1eb626b.browserify?fa64c4575df6c4e0f466062ff4330eb717508bdc:987:3252
invoke@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:323:34
run@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:216:50
http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:571:61
invokeTask@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:356:43
runTask@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:256:58
drainMicroTaskQueue@http://localhost:9876/base/node_modules/zone.js/dist/zone.js?8b9c8d0a7e549abe9edec8da5a095f206d206277:474:43
promiseReactionJob@http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2194:32
http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2182:27
handleMessage@http://localhost:9876/base/node_modules/es6-shim/es6-shim.js?e7f7126a0be128572b15e7524cb57a8a4d58684e:2139:15', line: 987, sourceURL: 'http://localhost:9876/absolute/var/folders/0h/gf8s5_tj7x7f953vj4yhyp5h0000gp/T/c2e92d78eba2d7ff1999b961b1eb626b.browserify?fa64c4575df6c4e0f466062ff4330eb717508bdc'}, promise: ZoneAwarePromise{__zone_symbol__state: 0, __zone_symbol__value: TypeError{stack: ..., line: ..., sourceURL: ...}}, zone: Zone{_properties: Object{}, _parent: null, _name: '<root>', _zoneDelegate: ZoneDelegate{_taskCounts: ..., zone: ..., _parentDelegate: ..., _forkZS: ..., _forkDlgt: ..., _interceptZS: ..., _interceptDlgt: ..., _invokeZS: ..., _invokeDlgt: ..., _handleErrorZS: ..., _handleErrorDlgt: ..., _scheduleTaskZS: ..., _scheduleTaskDlgt: ..., _invokeTaskZS: ..., _invokeTaskDlgt: ..., _cancelTaskZS: ..., _cancelTaskDlgt: ..., _hasTaskZS: ..., _hasTaskDlgt: ...}}, task: ZoneTask{runCount: 1, type: 'microTask', zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}