it('http success test',function(){returnexpect(fetch('http://localhost/')).to.be.successful();});it('http status assert',function(){returnexpect(fetch('http://localhost/')).to.haveStatus(500);});
Full status matchers list
API function
params
description
successful()
()
Assert that the status is 200 OK
created()
()
Assert that the status is 201
unauthorized()
()
Assert that the status is 401
rejected()
()
Assert that the status is 403
notFound()
()
Assert that the status is 404
serverError()
()
Assert that the status is 500
serviceUnAvailable()
()
Assert that the status is 503
haveStatus()
(status)
Assert that the status is provided number argument
Body matchers
it('have body object',()=>{returnexpect(fetch('http://localhost/').to.haveBodyObject({foo: 'bar'});});
Full body matchers list
API function
params
description
haveBodyObject()
(obj)
Assert equal provided object
haveBodyText()
(text)
Assert equal provided string text
haveBodyRegexpMatch()
(regexp)
Assert match body on regular expression
haveBodyThat()
(predicate(text))
Assert match body on provided function predicate on the text