use to.not.be.empty

This commit is contained in:
lohit 2024-12-15 17:27:47 +05:30 committed by GitHub
parent 4a4481a26f
commit 5a9bda2a0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -350,12 +350,7 @@ class AssertRuntime {
expect(lhs).to.be.empty;
break;
case 'isNotEmpty':
expect(lhs).to.not.be.oneOf([null, 0, false, '', []]);
if (Array.isArray(lhs)) {
expect(lhs).to.have.length.above(0);
} else if (typeof lhs === 'object' && lhs !== null) {
expect(Object.keys(lhs)).to.have.length.above(0);
}
expect(lhs).to.not.be.empty;
break;
case 'isNull':
expect(lhs).to.be.null;