Bende
Bende4h ago

finishAllScheduledFunctions breaking tests

I'm writing tests for a mutation that does scheduling -> first screenshot Schema -> second screenshot Test -> screenshot 3 The tests fail for obvious reasons when finishAllScheduledFunctions is not called, since the scheduled function is supposed to decrement a value until it's 0. Test output normal -> screenshot 4 But strange things start happening when finishAllScheduledFuntions is called: Test code with finishAllScheduledFunctions as per documentation -> Screenshot 5 Test output -> Screenshot 6 This is strange as per the schema note_id is not an optional field. When I add a further check to make sure note_id is not null, it then throws an error for assignees, which again, is mandatory: Screenshot 7. When I assignees is also checked, it then leads .toMatchObject() to look for the _id and _creationTime fields, which it usually doesn't look for: Screenshot 9. Though I could just work around it I feel like it's not intended so bringing it up here. Please let me know if any further information is needed.
No description
No description
No description
No description
No description
No description
No description
No description
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?