mirror of
https://github.com/strapi/strapi.git
synced 2025-07-31 04:45:54 +00:00
20 lines
389 B
JavaScript
Executable File
20 lines
389 B
JavaScript
Executable File
'use strict';
|
|
|
|
const assert = require('assert');
|
|
|
|
const context = require('../helpers/context');
|
|
|
|
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(err.status === 404);
|
|
assert(err.expose);
|
|
}
|
|
});
|
|
});
|