Skip to content

Commit 6e128a1

Browse files
committed
fix(test): tighten object type check to reject null
expect(typeof x).toBe('object') passes for null (typeof null === 'object'), weakening chai's .to.be.an('object'). Use expect.any(Object) which rejects null/undefined/primitives.
1 parent 2002667 commit 6e128a1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

typescript/deploy-sdk/src/core/core-artifact-reader.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ describe('CoreArtifactReader', () => {
326326

327327
// ASSERT
328328
expect(result.owner).toBe(mockOwner);
329-
expect(typeof result.defaultIsm).toBe('object');
330-
expect(typeof result.defaultHook).toBe('object');
331-
expect(typeof result.requiredHook).toBe('object');
329+
expect(result.defaultIsm).toEqual(expect.any(Object));
330+
expect(result.defaultHook).toEqual(expect.any(Object));
331+
expect(result.requiredHook).toEqual(expect.any(Object));
332332

333333
sinon.assert.calledOnce(readMailboxStub);
334334
sinon.assert.calledOnce(mockIsmReader.read);

0 commit comments

Comments
 (0)