![](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 to generate a database-setup script ...
I've written a vue.js webapp with appwrite-cloud-db (including relations) and everything works just perfectly! Now I want to release this webapp as an open sou...
- Issues with storage/database adding func...
Hi, I`m working on a register form where I need to upload a document to a storage as well as creating a new document in my database. For some reason I get an ex...
- redirect_uri_mismatch in Google OAuth2
Hi all. I'm hosting my appwrite on my own VPS but I', having trouble creating a session for an authenticated user via gmail. When I run the appwrite endpoint wi...
![](/images/bgs/pre-footer.png)