fix the skip event calculation (#242)

This commit is contained in:
yz-yu
2026-04-01 12:00:00 +08:00
committed by GitHub
parent ae71cf106a
commit a8b493799b
5 changed files with 67 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import * as puppeteer from 'puppeteer';
import { expect } from 'chai';
import { Suite } from 'mocha';
import { launchPuppeteer, sampleEvents as events } from './utils';
import { EventType } from '../src/types';
interface ISuite extends Suite {
code: string;
@@ -59,7 +60,11 @@ describe('replayer', function (this: ISuite) {
replayer.play();
replayer['timer']['actions'].length;
`);
expect(actionLength).to.equal(events.length);
expect(actionLength).to.equal(
events.filter(
(e) => ![EventType.DomContentLoaded, EventType.Load].includes(e.type),
).length,
);
});
it('will clean actions when pause', async () => {