2020-12-22 10:25:07 +01:00
|
|
|
/**
|
|
|
|
* Setup configuration for Jest
|
|
|
|
* This file includes global settings for the JEST environment.
|
|
|
|
*/
|
|
|
|
import 'mutationobserver-shim';
|
|
|
|
|
|
|
|
// @ts-ignore : Property '__VERDACCIO_BASENAME_UI_OPTIONS' does not exist on type 'Global'.
|
2021-04-15 21:10:28 +02:00
|
|
|
global.__VERDACCIO_BASENAME_UI_OPTIONS = {
|
2021-09-25 17:35:03 +02:00
|
|
|
base: 'http://localhost:9000/',
|
2021-04-15 21:10:28 +02:00
|
|
|
protocol: 'http',
|
|
|
|
host: 'localhost',
|
|
|
|
primaryColor: '#4b5e40',
|
|
|
|
url_prefix: '',
|
|
|
|
darkMode: false,
|
|
|
|
language: 'en-US',
|
2021-09-25 17:35:03 +02:00
|
|
|
uri: 'http://localhost:9000/',
|
2021-05-04 21:15:07 +02:00
|
|
|
pkgManagers: ['pnpm', 'yarn', 'npm'],
|
2021-04-15 21:10:28 +02:00
|
|
|
title: 'Verdaccio Dev UI',
|
|
|
|
scope: '',
|
|
|
|
version: 'v1.0.0',
|
|
|
|
};
|
2020-12-22 10:25:07 +01:00
|
|
|
|
|
|
|
// mocking few DOM methods
|
|
|
|
// @ts-ignore : Property 'document' does not exist on type 'Global'.
|
|
|
|
if (global.document) {
|
2021-04-15 21:10:28 +02:00
|
|
|
// @ts-ignore : Type 'Mock<{ selectNodeContents: () => void; }, []>' is not assignable to type '() => Range'.
|
2020-12-22 10:25:07 +01:00
|
|
|
document.createRange = jest.fn((): void => ({
|
|
|
|
selectNodeContents: (): void => {},
|
|
|
|
}));
|
|
|
|
document.execCommand = jest.fn();
|
|
|
|
}
|