it('local: should not return users that have no age', async () => {
const t = convexTest(schema);
await t.mutation(api.user.create, createUserParams);
const users = await t.query(api.user.list, queryParams);
expect(users).toEqual([]);
});
Error
the issue I think is that `typeof null` is `"object"`, and this was a case not considered in the implementation of the function.
also, supplementing the other lines of the stack trace for info
```typescript
FAIL convex/transaction.test.ts > creates transactions
TypeError: Cannot convert undefined or null to object
❯ isSimpleObject node_modules/convex-test/dist/index.js:414:30
412| const isSimple = prototype === null ||
413| prototype === Object.prototype ||
414| // Objects generated from other contexts (e.…
| ^
415| // conditions but are still simple objects.
416| prototype?.constructor?.name === "Object";
❯ evaluateFieldPath node_modules/convex-test/dist/index.js:426:18
❯ evaluateRangeFilter node_modules/convex-test/dist/index.js:493:20
❯ node_modules/convex-test/dist/index.js:265:56
❯ node_modules/convex-test/dist/index.js:265:38
❯ DatabaseFake._iterateDocs node_modules/convex-test/dist/index.js:232:21
❯ DatabaseFake._evaluateQuery node_modules/convex-test/dist/index.js:264:22
❯ DatabaseFake.startQuery node_modules/convex-test/dist/index.js:181:30
----
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Fix crashes in test when using nested optional properties in an index
Schema
Query Code
Test
Error