mirror of
https://github.com/maputnik/editor.git
synced 2026-08-25 14:37:27 +00:00
Fix build
This commit is contained in:
@@ -2,7 +2,6 @@ import fs from "node:fs";
|
|||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { expect, type Locator, type Page, type Request } from "@playwright/test";
|
import { expect, type Locator, type Page, type Request } from "@playwright/test";
|
||||||
import { readCoverage } from "./coverage";
|
|
||||||
import { currentPage, recordCoverageChunk } from "./utils/fixtures";
|
import { currentPage, recordCoverageChunk } from "./utils/fixtures";
|
||||||
import { ModalDriver } from "./modal-driver";
|
import { ModalDriver } from "./modal-driver";
|
||||||
|
|
||||||
@@ -297,8 +296,7 @@ export class MaputnikDriver {
|
|||||||
modal: this.modalDriver.when,
|
modal: this.modalDriver.when,
|
||||||
|
|
||||||
visit: async (url: string) => {
|
visit: async (url: string) => {
|
||||||
// Snapshot coverage before navigating, since a full page load resets it.
|
await recordCoverageChunk(this.page);
|
||||||
recordCoverageChunk(await readCoverage(this.page));
|
|
||||||
const target = url.startsWith("http") ? url : new URL(url, baseUrl).toString();
|
const target = url.startsWith("http") ? url : new URL(url, baseUrl).toString();
|
||||||
await this.page.goto(target);
|
await this.page.goto(target);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ export function writeCoverage(coverage: unknown, id: string): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Records a coverage snapshot (called before navigations, which reset __coverage__). */
|
/** Records a coverage snapshot (called before navigations, which reset __coverage__). */
|
||||||
export function recordCoverageChunk(chunk: unknown): void {
|
export async function recordCoverageChunk(page: Page): Promise<void> {
|
||||||
|
const chunk = await readCoverage(page);
|
||||||
if (chunk) coverageChunks.push(chunk);
|
if (chunk) coverageChunks.push(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user