1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/packages/web/test/helper.ts
Juan Picado 5167bb528f
feat: UI search uses search endpoint for global search (#3057)
* UI search uses search endpoint for global search

* improve sorting and error handling

* give priority to private packages

* order by private package

* add tests, improve testing

* add changeset

* addjust settings

* remove old index search implementation

* update lock file

* relocate fastify package

* fix circular dependency

* fix wrong import

* fix tests
2022-03-27 21:42:52 +02:00

23 lines
713 B
TypeScript

import { Application } from 'express';
import path from 'path';
import apiMiddleware from '@verdaccio/api';
import { parseConfigFile } from '@verdaccio/config';
import { setup } from '@verdaccio/logger';
import { Storage } from '@verdaccio/store';
import { initializeServer as initializeServerHelper } from '@verdaccio/test-helper';
import routes from '../src';
setup([]);
export const getConf = (configName: string) => {
const configPath = path.join(__dirname, 'config', configName);
return parseConfigFile(configPath);
};
// @deprecated
export async function initializeServer(configName): Promise<Application> {
return initializeServerHelper(getConf(configName), [apiMiddleware, routes], Storage);
}