No need to wrap code into an anonymous function here. `expect(promiseService.loadRoot).toThrow()` should work quite fine.