mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
7f1d3ebc07
- move all test files from core/test to test/ - updated all imports and other references - all code inside of core/ is then application code - tests are correctly at the root level - consistent with other repos/projects Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
20 lines
622 B
JavaScript
20 lines
622 B
JavaScript
var should = require('should'),
|
|
errorProps = ['message', 'errorType'];
|
|
|
|
should.Assertion.add('JSONErrorObject', function () {
|
|
this.params = {operator: 'to be a valid JSON Error Object'};
|
|
this.obj.should.be.an.Object();
|
|
this.obj.should.have.properties(errorProps);
|
|
});
|
|
|
|
should.Assertion.add('JSONErrorResponse', function () {
|
|
this.params = {operator: 'to be a valid JSON Error Response'};
|
|
|
|
this.obj.should.have.property('errors').which.is.an.Array();
|
|
this.obj.errors.length.should.be.above(0);
|
|
|
|
this.obj.errors.forEach(function (err) {
|
|
err.should.be.a.JSONErrorObject();
|
|
});
|
|
});
|