mirror of
https://github.com/eggjs/egg.git
synced 2024-12-04 07:14:30 +00:00
Show who define the property of the config Closes https://github.com/eggjs/egg/issues/1132
27 lines
584 B
JavaScript
27 lines
584 B
JavaScript
'use strict';
|
|
|
|
const mm = require('egg-mock');
|
|
const utils = require('../../utils');
|
|
|
|
describe('test/lib/plugins/onerror.test.js', () => {
|
|
let app;
|
|
before(() => {
|
|
mm.env('local');
|
|
mm(process.env, 'EGG_LOG', 'none');
|
|
app = utils.app('apps/onerror');
|
|
return app.ready();
|
|
});
|
|
|
|
after(() => app.close());
|
|
|
|
afterEach(mm.restore);
|
|
|
|
it('should redirect to error page', () => {
|
|
mm(app.config, 'env', 'test');
|
|
return app.httpRequest()
|
|
.get('/?status=500')
|
|
.expect('Location', 'http://eggjs.org/500?real_status=500')
|
|
.expect(302);
|
|
});
|
|
});
|