mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-19 20:01:52 +00:00
fix(scenario): include error messages in XML output
Fix the XML output of scenario tests so that it properly includes error messages from failing specs.
This commit is contained in:
parent
92ca7efaa4
commit
d46fe3c23f
2 changed files with 15 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ angular.scenario.output('xml', function(context, runner, model) {
|
||||||
if (step.error) {
|
if (step.error) {
|
||||||
var error = $('<error></error>');
|
var error = $('<error></error>');
|
||||||
stepContext.append(error);
|
stepContext.append(error);
|
||||||
error.text(formatException(stepContext.error));
|
error.text(formatException(step.error));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
describe('angular.scenario.output.json', function() {
|
describe('angular.scenario.output.xml', function() {
|
||||||
var output, context;
|
var output, context;
|
||||||
var runner, model, $window;
|
var runner, model, $window;
|
||||||
var spec, step;
|
var spec, step;
|
||||||
|
|
@ -33,4 +33,17 @@ describe('angular.scenario.output.json', function() {
|
||||||
expect(context.find('it').attr('status')).toEqual('success');
|
expect(context.find('it').attr('status')).toEqual('success');
|
||||||
expect(context.find('it step').attr('status')).toEqual('success');
|
expect(context.find('it step').attr('status')).toEqual('success');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should output errors to the XML', function() {
|
||||||
|
runner.emit('SpecBegin', spec);
|
||||||
|
runner.emit('StepBegin', spec, step);
|
||||||
|
runner.emit('StepFailure', spec, step, 'error reason');
|
||||||
|
runner.emit('StepEnd', spec, step);
|
||||||
|
runner.emit('SpecEnd', spec);
|
||||||
|
runner.emit('RunnerEnd');
|
||||||
|
|
||||||
|
expect(context.find('it').attr('status')).toEqual('failure');
|
||||||
|
expect(context.find('it step').attr('status')).toEqual('failure');
|
||||||
|
expect(context.find('it step').text()).toEqual('error reason');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue