Skip to content

Instantly share code, notes, and snippets.

@khaosdoctor
Created July 12, 2017 02:46
Show Gist options
  • Save khaosdoctor/3dc84f9599c6afcbaba1fd28f464d244 to your computer and use it in GitHub Desktop.
Save khaosdoctor/3dc84f9599c6afcbaba1fd28f464d244 to your computer and use it in GitHub Desktop.
Failure Test for status API
describe('Should return 503 when the api or the database are not ok', (assert) => {
assert.plan(1)
let dbMock = { // Cria um modelo do objeto do banco de dados apenas com as propriedades que a rota chama
connection: {
readyState: 0
}
}
func(assert.context.routeContext, null, dbMock)
assert.deepEqual(assert.context.routeContext.status, 503)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment