0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/packages/node-api/test/run-server.spec.ts
Juan Picado dc571aabd2
feat: add forceEnhancedLegacySignature (#3655)
* feat: add forceEnhancedLegacySignature

* Create rare-planets-travel.md

* Update run-server.spec.ts

* Update run-server.spec.ts
2023-02-26 22:24:00 +01:00

21 lines
643 B
TypeScript

import request from 'supertest';
import { runServer } from '../src';
describe('startServer via API', () => {
test('should provide all HTTP server data', async () => {
const webServer = await runServer();
expect(webServer).toBeDefined();
await request(webServer).get('/').expect(200);
});
test('should fail on start with empty configuration', async () => {
// @ts-expect-error
await expect(runServer({})).rejects.toThrow('configPath property is required');
});
test('should fail on start with null as entry', async () => {
// @ts-expect-error
await expect(runServer(null)).rejects.toThrow();
});
});