mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
a1986e098d
* feat: expose middleware utils * feat: expose middleware utils * Update antiLoop.ts * Update e2e-ci.yml
28 lines
622 B
TypeScript
28 lines
622 B
TypeScript
import path from 'path';
|
|
import request from 'supertest';
|
|
|
|
import { HTTP_STATUS } from '@verdaccio/core';
|
|
import { setup } from '@verdaccio/logger';
|
|
|
|
import { log } from '../src';
|
|
import { getApp } from './helper';
|
|
|
|
setup({
|
|
type: 'file',
|
|
path: path.join(__dirname, './verdaccio.log'),
|
|
level: 'trace',
|
|
format: 'json',
|
|
});
|
|
|
|
test('should log request', async () => {
|
|
const app = getApp([]);
|
|
// @ts-ignore
|
|
app.use(log);
|
|
// @ts-ignore
|
|
app.get('/:package', (req, res) => {
|
|
res.status(HTTP_STATUS.OK).json({});
|
|
});
|
|
|
|
// TODO: pending output
|
|
return request(app).get('/react').expect(HTTP_STATUS.OK);
|
|
});
|