mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
4f6609a072
* migrate vitest ui-components * migrate vitest ui-components * fix e2e * cleanup
33 lines
888 B
TypeScript
33 lines
888 B
TypeScript
import '@testing-library/jest-dom';
|
|
import 'whatwg-fetch';
|
|
|
|
import { server } from './server';
|
|
|
|
// Configure the test environment URL
|
|
Object.defineProperty(window, 'location', {
|
|
writable: true,
|
|
value: new URL('http://localhost:9000/'),
|
|
});
|
|
|
|
beforeAll(() => {
|
|
// Enable debug logging
|
|
// server.events.on('request:start', (req) => {
|
|
// console.log('Request started:', req.url.href);
|
|
// });
|
|
// server.events.on('request:match', (req) => {
|
|
// console.log('Request matched:', req.url.href);
|
|
// });
|
|
// server.events.on('request:unhandled', (req) => {
|
|
// console.warn('Unhandled request:', req.url.href);
|
|
// });
|
|
// server.events.on('request:end', (req) => {
|
|
// console.log('Request completed:', req.url.href);
|
|
// });
|
|
server.listen({
|
|
onUnhandledRequest: 'warn',
|
|
});
|
|
});
|
|
afterEach(() => server.resetHandlers());
|
|
afterAll(() => {
|
|
server.close();
|
|
});
|