I've updated to appwrite 1.5 and and node-appwrite 12.0.1. Whenever I try to run a test which fakes the system time my request to create a new document keeps processing and does not complete at all. This is the code:
it('Should return work when an active work period is active', async () => {
// Arrange
const startDate = new Date(2024, 2, 2, 12).toISOString();
jest.useFakeTimers().setSystemTime(new Date(2024, 2, 2, 13));
await presencePeriodRepo.createDocument({
userId: testUserId,
startDate,
type: PresencePeriodType.Work,
expectedEndDate: new Date(2024, 2, 2, 17).toISOString(),
});
// Act
const result = await controller.getPresenceStatus(client);
// Assert
expect(result.status).toBe(PresenceStatus.Work);
})
Whenever I remove the usefakeTimers line the createDocument call completes just fine. This is the implementation of the createDocument function:
public async createDocument(data: Schema, permissions?: string[]): Promise<Schema & Models.Document> {
return this.databases.createDocument(this.databaseId, this.collectionId, ID.unique(), data, permissions);
}
Note this code was working fine in Appwrite 1.4.
Recommended threads
- Does 1.9.0 Self Hosted have MongoDB Atla...
I have been playing with the new 1.9.0 update and I am really excited for the MongoDB support. I wanted to ask though if at the current time Appwrite supports b...
- {"code": 1008, "message": "Invalid Origi...
Nothing has changed in my application or console settings so I'm curious as to what I need to do to fix this. I already have the client registered so I'm not en...
- significant increase in CPU usage with 1...
Hi, This is no big deal at all (as everything is working great so far), but I just saw that the update (from 1.8 to 1.9) consumes much more CPU than before (re...