mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Removed custom assertions
- these are no longer used in favor of snapshots in tests
This commit is contained in:
parent
08f84475e7
commit
42333a3349
1 changed files with 0 additions and 18 deletions
|
@ -1,22 +1,4 @@
|
||||||
const should = require('should');
|
const should = require('should');
|
||||||
const errorProps = ['message', 'errorType'];
|
|
||||||
const {matchSnapshotAssertion} = require('@tryghost/express-test').snapshot;
|
const {matchSnapshotAssertion} = require('@tryghost/express-test').snapshot;
|
||||||
|
|
||||||
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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
should.Assertion.add('matchSnapshot', matchSnapshotAssertion);
|
should.Assertion.add('matchSnapshot', matchSnapshotAssertion);
|
||||||
|
|
Loading…
Add table
Reference in a new issue