fix: console assert only logs when arg 0 is falsy (#1530)

* fix: console assert only logs when arg 0 is falsy
This commit is contained in:
Paul D'Ambra
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 83e8dd8ab7
commit e1632d69c6
4 changed files with 53 additions and 36 deletions

View File

@@ -94,7 +94,10 @@ describe('rrweb-plugin-console-record', () => {
await page.goto(`${serverUrl}test/html/log.html`);
await page.evaluate(() => {
console.assert(0 === 0, 'assert');
// truthy assert does not log
console.assert(0 === 0, 'should not log assert');
// falsy assert does log
console.assert(false, 'should log assert');
console.count('count');
console.countReset('count');
console.debug('debug');