0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00
verdaccio/packages/node-api/test/run-server.spec.ts
Juan Picado 64cfedb805
chore(website): add api section (#3424)
* chore: add api section

* chore: fix build

* Update website.yml

* chore: improve types plugin

clean up others stuff

* Update crowdin.yaml

* clean up
2022-10-10 08:00:09 +02:00

21 lines
635 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('config_path is required');
});
test('should fail on start with null as entry', async () => {
// @ts-expect-error
await expect(runServer(null)).rejects.toThrow();
});
});