mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-22 09:51:35 +03:00
19 lines
626 B
TypeScript
19 lines
626 B
TypeScript
import { dirname, join } from 'node:path';
|
|
|
|
import type { Page } from '@playwright/test';
|
|
|
|
declare global {
|
|
function readAffineDatabase(): Promise<any>;
|
|
function writeAffineDatabase(data: any, binaries: any): Promise<void>;
|
|
function readAffineLocalStorage(): Promise<any>;
|
|
function writeAffineLocalStorage(data: any): Promise<void>;
|
|
}
|
|
|
|
export async function patchDataEnhancement(page: Page) {
|
|
const idbPath = join(dirname(require.resolve('idb')), 'umd.js');
|
|
await page.addInitScript({ path: idbPath });
|
|
|
|
const patchPath = join(__dirname, './storage-patch.js');
|
|
await page.addInitScript({ path: patchPath });
|
|
}
|