fix(Assertion): Improve toHaveProperty alias by forwarding arguments correctly for intuitive object property assertions

This commit is contained in:
2025-04-30 19:37:19 +00:00
parent 62cf7f5db5
commit ff795f6fe0
9 changed files with 76 additions and 2 deletions

View File

@ -5,6 +5,7 @@ tap.test('toHaveProperty nested path via dot notation', async () => {
const testObject = { level1: { level2: { level3: 'value' }}, publicTest: 'hi' };
smartexpect.expect(testObject).object.toHaveProperty('publicTest');
smartexpect.expect(testObject).toHaveProperty('publicTest');
// Existence check
smartexpect.expect(testObject).object.toHaveProperty('level1.level2.level3');
// Value check