Pretty print objects passed to fail method

Fixes #1090
This commit is contained in:
mmmichl
2017-02-26 19:25:02 +01:00
parent 43f96d3ecd
commit 8807bbb850
2 changed files with 20 additions and 2 deletions

View File

@@ -181,6 +181,12 @@ describe("Env integration", function() {
}
})]
}));
expect(specDone).toHaveBeenCalledWith(jasmine.objectContaining({
description: 'pretty prints objects',
failedExpectations: [jasmine.objectContaining({
message: 'Failed: Object({ prop: \'value\', arr: [ \'works\', true ] })'
})]
}));
done();
}
});
@@ -197,6 +203,10 @@ describe("Env integration", function() {
env.it('has a message and stack trace from an Error', function() {
env.fail(new Error('error message'));
});
env.it('pretty prints objects', function() {
env.fail({prop: 'value', arr: ['works', true]});
})
});
env.execute();