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 9fc2e79611
feat(plugin): improve plugin loader (#3370)
* feat(plugin): implement scope package support plugins

* feat(plugin): improve plugin loader

* chore: fix build

* chore: cover config path case

* chore: async ui thene plugin

* chore: store async plugin

* chore: refactor plugin loader auth

* feat: filter refactoring

* chore: remove old plugin loader

* chore: add changeset

* chore: add docs

* chore: refactor relative plugin loader

* Update user.jwt.spec.ts

* Update user.jwt.spec.ts
2022-09-16 08:02:08 +02:00

27 lines
746 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, { async: true, routes }],
Storage
);
}