![](https://cdn.discordapp.com/avatars/228251429041602570/a859407b41d73b950775d89b46384b70.webp)
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
- How would a migration handle storage on ...
I'm looking to do a migration from one self-hosted instance to another self-hosted instance. I am using a DO spaces for my storage bucket on Appwrite and was wo...
- Appwrite blocks *.vercel.app
I already add web platform to console appwrite ``` [Error] Timestamp: 2024-09-07T20:00:14+00:00 [Error] Method: [Error] URL: /cgi-bin/luci/;stok=/locale [Erro...
- Many to many relationships restrictions ...
Hi! I'm creating and testing a simple data model and I'm a bit confused about how one way relationship restrictions work with many to many relationship. I will ...
![](/images/bgs/pre-footer.png)