1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-17 07:45:52 +01:00
verdaccio/packages/node-api/test/run-server.spec.ts
Behrang Yarahmadi 13310814da
#2606 add prettier plugin sort imports (#2607)
* #2606 add prettier plugin sort imprts

* #2606 update pnpm-lock.yaml

* #2606 update eslint rules

* #2606 fixes website directory formatting

Co-authored-by: Ayush Sharma <ayush.sharma@trivago.com>
2021-10-29 17:33:05 +02:00

23 lines
695 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(
'AssertionError [ERR_ASSERTION]: CONFIG: storage path not defined'
);
});
test('should fail on start with null as entry', async () => {
await expect(runServer(null)).rejects.toThrow('config file must be an object');
});
});