19 lines
384 B
JavaScript
19 lines
384 B
JavaScript
|
|
'use strict';
|
|
|
|
const context = require('../helpers/context');
|
|
const assert = require('assert');
|
|
|
|
describe('ctx.assert(value, status)', function(){
|
|
it('should throw an error', function(){
|
|
const ctx = context();
|
|
|
|
try {
|
|
ctx.assert(false, 404);
|
|
throw new Error('asdf');
|
|
} catch (err) {
|
|
assert(404 == err.status);
|
|
assert(err.expose);
|
|
}
|
|
});
|
|
});
|