Skip to content

Lightpanda: the headless browser designed for AI and automation

test: loosen error message assertions

Karl Seguinee612ace7218
diff --git a/src/browser/tests/cdata/character_data.html b/src/browser/tests/cdata/character_data.html
index 85513b00f..8644577e3 100644
--- a/src/browser/tests/cdata/character_data.html
+++ b/src/browser/tests/cdata/character_data.html
@@ -92,7 +92,7 @@
{
// deleteData with invalid offset
const text = document.createTextNode('Hello');
- testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => text.deleteData(10, 5));
+ testing.expectError('IndexSizeError', () => text.deleteData(10, 5));
testing.expectEqual('Hello', text.data); // unchanged
}
</script>
@@ -137,7 +137,7 @@
{
// insertData with invalid offset
const text = document.createTextNode('Hello');
- testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => text.insertData(10, 'X'));
+ testing.expectError('IndexSizeError', () => text.insertData(10, 'X'));
testing.expectEqual('Hello', text.data);
}
</script>
@@ -228,7 +228,7 @@
{
// substringData with invalid offset
const text = document.createTextNode('Hello');
- testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => text.substringData(10, 5));
+ testing.expectError('IndexSizeError', () => text.substringData(10, 5));
}
</script>
diff --git a/src/browser/tests/element/html/input.html b/src/browser/tests/element/html/input.html
index c96638b86..8f09d572e 100644
--- a/src/browser/tests/element/html/input.html
+++ b/src/browser/tests/element/html/input.html
@@ -46,7 +46,7 @@
testing.expectEqual(5, input.maxLength);
input.maxLength = 'banana';
testing.expectEqual(0, input.maxLength);
- testing.expectError('IndexSizeError: Index or size is negative or greater than the allowed amount', () => { input.maxLength = -45;});
+ testing.expectError('IndexSizeError', () => { input.maxLength = -45;});
testing.expectEqual(20, input.size);
input.size = 5;