mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-19 07:17:00 +08:00
fix: add prefer-blob-reading-methods rule (#5118)
This commit is contained in:
@@ -368,18 +368,10 @@ test('can sync svg between different browsers', async ({ page, browser }) => {
|
||||
expect(src).not.toBeNull();
|
||||
|
||||
// fetch the src resource in the browser
|
||||
const svg2 = await page2.evaluate(async src => {
|
||||
async function blobToString(blob: Blob) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onloadend = () => resolve(reader.result);
|
||||
reader.onerror = reject;
|
||||
reader.readAsText(blob);
|
||||
});
|
||||
}
|
||||
|
||||
const blob = fetch(src!).then(res => res.blob());
|
||||
return blobToString(await blob);
|
||||
const svg2 = await page2.evaluate(src => {
|
||||
return fetch(src!)
|
||||
.then(res => res.blob())
|
||||
.then(blob => blob.text());
|
||||
}, src);
|
||||
|
||||
// turn the blob into string and check if it contains the svg
|
||||
|
||||
Reference in New Issue
Block a user