0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00

test: relocate helpers

This commit is contained in:
Juan Picado @jotadeveloper 2019-05-19 21:03:45 +02:00
parent cb7b695896
commit d052bcef89
No known key found for this signature in database
GPG key ID: 18AC54485952D158
11 changed files with 18 additions and 16 deletions

View file

@ -1,5 +1,5 @@
import path from 'path';
export const parseConfigurationFile = (name) => {
return path.join(__dirname, `./partials/config/yaml/${name}.yaml`);
return path.join(__dirname, `../partials/config/yaml/${name}.yaml`);
};

View file

@ -9,9 +9,11 @@ import type {IServerBridge} from '../../types';
export function mockServer(port: number) {
const pathStore = path.join(__dirname, '../partials');
const verdaccioConfig = new VerdaccioConfig(
path.join(pathStore, '/mock-store'),
path.join(pathStore, '/config-unit-mock-server-test.yaml'), `http://${DOMAIN_SERVERS}:${port}/`, port);
const storePath = path.join(pathStore, '/mock-store');
const configPath = path.join(pathStore, '/config-unit-mock-server-test.yaml');
const verdaccioConfig = new VerdaccioConfig(storePath, configPath, `http://${DOMAIN_SERVERS}:${port}/`, port);
const server: IServerBridge = new Server(verdaccioConfig.domainPath);
return new VerdaccioProcess(verdaccioConfig, server, false, false, false);

View file

@ -8,11 +8,11 @@ import rimraf from 'rimraf';
import endPointAPI from '../../../src/api/index';
import {HEADERS, HTTP_STATUS, HEADER_TYPE} from '../../../src/lib/constants';
import {mockServer} from './mock';
import {mockServer} from '../__helper/mock';
import {DOMAIN_SERVERS} from '../../functional/config.functional';
import {parseConfigFile} from '../../../src/lib/utils';
import {parseConfigurationFile} from '../__helper';
import {addUser, getPackage} from './__api-helper';
import {addUser, getPackage} from '../__helper/api';
import {setup} from '../../../src/lib/logger';
import {buildUserBuffer} from '../../../src/lib/auth-utils';

View file

@ -6,7 +6,7 @@ import rimraf from 'rimraf';
import { HEADERS, HTTP_STATUS } from '../../../src/lib/constants';
import configDefault from '../partials/config/config_access';
import endPointAPI from '../../../src/api/index';
import {mockServer} from './mock';
import {mockServer} from '../__helper/mock';
import {DOMAIN_SERVERS} from '../../functional/config.functional';
require('../../../src/lib/logger').setup([]);

View file

@ -6,10 +6,10 @@ import path from 'path';
import rimraf from 'rimraf';
import endPointAPI from '../../../src/api/index';
import {mockServer} from './mock';
import {mockServer} from '../__helper/mock';
import {parseConfigFile} from '../../../src/lib/utils';
import {parseConfigurationFile} from '../__helper';
import {getNewToken, getProfile, postProfile} from './__api-helper';
import {getNewToken, getProfile, postProfile} from '../__helper/api';
import {setup} from '../../../src/lib/logger';
import {API_ERROR, HTTP_STATUS, SUPPORT_ERRORS} from '../../../src/lib/constants';

View file

@ -9,10 +9,10 @@ import starMetadata from '../partials/star-api';
import endPointAPI from '../../../src/api/index';
import {HEADERS, API_ERROR, HTTP_STATUS, HEADER_TYPE, API_MESSAGE, TOKEN_BEARER} from '../../../src/lib/constants';
import {mockServer} from './mock';
import {mockServer} from '../__helper/mock';
import {DOMAIN_SERVERS} from '../../functional/config.functional';
import {buildToken} from '../../../src/lib/utils';
import {getNewToken} from './__api-helper';
import {getNewToken} from '../__helper/api';
require('../../../src/lib/logger').setup([]);
const credentials = { name: 'jota', password: 'secretPass' };

View file

@ -9,8 +9,8 @@ import endPointAPI from '../../../src/api/index';
import { HEADERS, API_ERROR, HTTP_STATUS, HEADER_TYPE, DIST_TAGS} from '../../../src/lib/constants';
import {DOMAIN_SERVERS} from '../../functional/config.functional';
import {mockServer} from './mock';
import {addUser} from './__api-helper';
import {mockServer} from '../__helper/mock';
import {addUser} from '../__helper/api';
require('../../../src/lib/logger').setup([]);

View file

@ -12,7 +12,7 @@ import {setup} from '../../../src/lib/logger';
import type {Config} from '@verdaccio/types';
import type {IStorageHandler} from '../../../types/index';
import {API_ERROR, HTTP_STATUS} from '../../../src/lib/constants';
import {mockServer} from './mock';
import {mockServer} from '../__helper/mock';
import {DOMAIN_SERVERS} from '../../functional/config.functional';
setup([]);

View file

@ -9,7 +9,7 @@ import {setup} from '../../../src/lib/logger';
import type {Config, UpLinkConf} from '@verdaccio/types';
import type {IProxy} from '../../../types/index';
import {API_ERROR, HTTP_STATUS} from "../../../src/lib/constants";
import {mockServer} from './mock';
import {mockServer} from '../__helper/mock';
import {DOMAIN_SERVERS} from '../../functional/config.functional';
setup([]);

View file

@ -2,7 +2,7 @@
import _ from 'lodash';
import smartRequest, {PromiseAssert} from '../../lib/request';
import {mockServer} from '../api/mock';
import {mockServer} from '../__helper/mock';
import {HTTP_STATUS} from '../../../src/lib/constants';
import type {IRequestPromise} from '../../types';