2017-12-02 05:19:08 -05:00
|
|
|
// we need this for notifications
|
2019-07-16 01:40:01 -05:00
|
|
|
import { setup } from '../../src/lib/logger';
|
|
|
|
|
2021-03-30 13:32:46 -05:00
|
|
|
setup({});
|
2017-12-02 05:19:08 -05:00
|
|
|
|
2021-03-14 02:42:46 -05:00
|
|
|
import { IServerBridge } from '../types';
|
2017-12-01 19:50:09 -05:00
|
|
|
|
2018-06-17 09:00:36 -05:00
|
|
|
import basic from './basic/basic';
|
|
|
|
import packageAccess from './package/access';
|
|
|
|
import packageGzip from './package/gzip';
|
|
|
|
import packageScoped from './package/scoped';
|
|
|
|
import tags from './tags/tags';
|
2018-06-23 09:34:22 -05:00
|
|
|
import distTagsMerge from './tags/dist-tags-merge';
|
2018-06-17 09:00:36 -05:00
|
|
|
import addtag from './tags/addtag';
|
2017-12-02 05:19:08 -05:00
|
|
|
import adduser from './adduser/adduser';
|
|
|
|
import logout from './adduser/logout';
|
|
|
|
import notify from './notifications/notify';
|
|
|
|
import incomplete from './sanity/incomplete';
|
|
|
|
import mirror from './sanity/mirror';
|
2018-06-17 09:00:36 -05:00
|
|
|
import readme from './readme/readme';
|
2018-06-19 15:02:29 -05:00
|
|
|
import gh29 from './scenarios/gh29';
|
2017-12-02 05:19:08 -05:00
|
|
|
import nullstorage from './sanity/nullstorage';
|
2018-06-23 09:34:22 -05:00
|
|
|
import simpleSearch from './search/simple.search';
|
2017-12-02 05:19:08 -05:00
|
|
|
import racycrash from './sanity/racycrash';
|
|
|
|
import security from './sanity/security';
|
|
|
|
import race from './performance/race';
|
2018-06-17 09:00:36 -05:00
|
|
|
import pluginsAuth from './plugins/auth';
|
2018-06-22 13:54:14 -05:00
|
|
|
import middleware from './plugins/middleware';
|
2018-06-19 15:02:29 -05:00
|
|
|
import upLinkCache from './uplinks/cache';
|
2019-06-13 14:42:01 -05:00
|
|
|
import uplinkTimeout from './uplinks/timeout';
|
2017-12-01 19:50:09 -05:00
|
|
|
|
2021-03-14 02:42:46 -05:00
|
|
|
describe('functional test verdaccio', function () {
|
2019-07-16 01:40:01 -05:00
|
|
|
jest.setTimeout(20000);
|
|
|
|
// @ts-ignore
|
2018-06-18 15:58:09 -05:00
|
|
|
const server1: IServerBridge = global.__SERVERS__[0];
|
2019-07-16 01:40:01 -05:00
|
|
|
// @ts-ignore
|
2018-06-18 15:58:09 -05:00
|
|
|
const server2: IServerBridge = global.__SERVERS__[1];
|
2019-07-16 01:40:01 -05:00
|
|
|
// @ts-ignore
|
2018-06-18 15:58:09 -05:00
|
|
|
const server3: IServerBridge = global.__SERVERS__[2];
|
2019-07-16 01:40:01 -05:00
|
|
|
// @ts-ignore
|
2018-06-18 15:58:09 -05:00
|
|
|
const app = global.__WEB_SERVER__.app;
|
2017-12-01 19:50:09 -05:00
|
|
|
|
2017-12-03 16:23:06 -05:00
|
|
|
// list of test
|
2019-07-16 01:40:01 -05:00
|
|
|
// note: order of the following calls is important, the reason is legacy code.
|
2017-12-03 16:23:06 -05:00
|
|
|
packageAccess(server1);
|
|
|
|
gh29(server1, server2);
|
2018-06-18 15:58:09 -05:00
|
|
|
tags(server1, app);
|
|
|
|
packageGzip(server1, app);
|
|
|
|
incomplete(server1, app);
|
2017-12-03 16:23:06 -05:00
|
|
|
mirror(server1, server2);
|
2018-06-23 09:34:22 -05:00
|
|
|
distTagsMerge(server1, server2, server3);
|
2017-12-03 16:23:06 -05:00
|
|
|
readme(server1, server2);
|
|
|
|
nullstorage(server1, server2);
|
2018-06-22 13:54:14 -05:00
|
|
|
middleware(server2);
|
2017-12-03 16:23:06 -05:00
|
|
|
race(server1);
|
2018-06-18 15:58:09 -05:00
|
|
|
racycrash(server1, app);
|
2017-12-03 16:23:06 -05:00
|
|
|
packageScoped(server1, server2);
|
|
|
|
security(server1);
|
|
|
|
addtag(server1);
|
|
|
|
pluginsAuth(server2);
|
2019-07-16 01:40:01 -05:00
|
|
|
notify(app);
|
2019-06-13 14:42:01 -05:00
|
|
|
uplinkTimeout(server1, server2, server3);
|
2017-12-02 05:19:08 -05:00
|
|
|
// requires packages published to server1/server2
|
2017-12-03 16:23:06 -05:00
|
|
|
upLinkCache(server1, server2, server3);
|
|
|
|
adduser(server1);
|
|
|
|
logout(server1);
|
2018-06-18 15:58:09 -05:00
|
|
|
basic(server1, server2);
|
2021-03-14 02:42:46 -05:00
|
|
|
simpleSearch(server1, server2, app);
|
2017-12-02 05:19:08 -05:00
|
|
|
});
|
2017-12-01 19:50:09 -05:00
|
|
|
|
2021-03-14 02:42:46 -05:00
|
|
|
process.on('unhandledRejection', function (err) {
|
|
|
|
console.error('unhandledRejection', err);
|
|
|
|
process.nextTick(function () {
|
2017-12-03 16:23:06 -05:00
|
|
|
throw err;
|
|
|
|
});
|
2017-12-01 19:50:09 -05:00
|
|
|
});
|