Hi,
I've looked at many similar threads around this issue but I just can't seem
to adapt any of the solutions I am seeing to fit my issue.
I am writing a test that module "mod" when bootstrapped, will throw an
error in the run function of the module.
So I have
module('mod').value('someDependency', { someData })
module('mod').run(function(someDependency) { someLogicThatChangesSomeData,
someLogicThatThrowsException });
In my tests I am asserting some changes to someData then asserting an
exception is thrown from the other logic.
module(function($exceptionHandlerProvider) {
$exceptionHandlerProvider.mode('log');
});
module('mod', function($provide) {
$provide.value('someData', { ... });
});
var handler;
inject(function($exceptionHandler) {
handler = $exceptionHandler;
});
console.debug(handler.errors.length);
After this I expect to work with handler.errors array somehow, but the
exception that is thrown (that I am expecting), just seems to fail the test
and it stops there. No code I put below, console debug/log or otherwise, is
executed.
If I put the inject about the 'mod', then I get:
Error: Injector already created, can not register a module!
Any help would be appreciated, thanks!
Brian
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.