mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
test: add SENTRY env
This commit is contained in:
@@ -11,6 +11,8 @@ if (config.sentry) {
|
||||
Sentry.configureScope((scope) => {
|
||||
scope.setTag('node_name', config.nodeName);
|
||||
});
|
||||
|
||||
logger.info('Sentry inited.');
|
||||
}
|
||||
|
||||
module.exports = async (ctx, next) => {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
process.env.SENTRY = 'https://mock@mock.com/1';
|
||||
|
||||
const supertest = require('supertest');
|
||||
const { server } = require('../../lib/index');
|
||||
const request = supertest(server);
|
||||
@@ -6,6 +8,10 @@ afterAll(() => {
|
||||
server.close();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
delete process.env.SENTRY;
|
||||
});
|
||||
|
||||
describe('error', () => {
|
||||
it(`error`, async () => {
|
||||
const response = await request.get('/test/error');
|
||||
|
||||
Reference in New Issue
Block a user