update typescript and fix test cases

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 32c33f3ce8
commit ebaa318d54
4 changed files with 27 additions and 6 deletions

View File

@@ -11,6 +11,14 @@ import {
EventType,
} from '../src/types';
import { assertSnapshot } from './utils';
import { Suite } from 'mocha';
interface ISuite extends Suite {
code: string;
browser: puppeteer.Browser;
page: puppeteer.Page;
events: eventWithTime[];
}
interface IWindow extends Window {
rrweb: {
@@ -19,7 +27,7 @@ interface IWindow extends Window {
emit: (e: eventWithTime) => undefined;
}
describe('record', () => {
describe('record', function(this: ISuite) {
before(async () => {
this.browser = await puppeteer.launch({
headless: false,