mirror of
https://github.com/zoriya/flood.git
synced 2025-12-06 07:16:18 +00:00
refactor: use fastify (#661)
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
import fastify from 'fastify';
|
||||
import fs from 'fs';
|
||||
import supertest from 'supertest';
|
||||
|
||||
import app from '../../app';
|
||||
import constructRoutes from '..';
|
||||
import {getAuthToken} from '../../util/authUtil';
|
||||
import {getTempPath} from '../../models/TemporaryStorage';
|
||||
|
||||
import type {AddFeedOptions, AddRuleOptions, ModifyFeedOptions} from '../../../shared/types/api/feed-monitor';
|
||||
import type {Feed, Rule} from '../../../shared/types/Feed';
|
||||
|
||||
const request = supertest(app);
|
||||
const app = fastify({disableRequestLogging: true, logger: false});
|
||||
let request: supertest.SuperTest<supertest.Test>;
|
||||
|
||||
beforeAll(async () => {
|
||||
await constructRoutes(app);
|
||||
await app.ready();
|
||||
request = supertest(app.server);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await app.close();
|
||||
});
|
||||
|
||||
const authToken = `jwt=${getAuthToken('_config')}`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user