mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-16 12:33:48 +00:00
Run tests in a headless browser with vitest browser mode and playwright
This commit is contained in:
@@ -24,17 +24,13 @@ describe('ServersExporter', () => {
|
||||
const createCsvjsonMock = (throwError = false) => (throwError ? erroneousToCsv : vi.fn(() => ''));
|
||||
|
||||
describe('exportServers', () => {
|
||||
let originalConsole: Console;
|
||||
const error = vi.fn();
|
||||
|
||||
beforeEach(() => {
|
||||
originalConsole = global.console;
|
||||
global.console = fromPartial<Console>({ error });
|
||||
(global as any).Blob = class Blob {};
|
||||
(global as any).URL = { createObjectURL: () => '' };
|
||||
vi.stubGlobal('console', fromPartial<Console>({ error }));
|
||||
});
|
||||
afterEach(() => {
|
||||
global.console = originalConsole;
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
it('logs an error if something fails', () => {
|
||||
|
||||
Reference in New Issue
Block a user