prismock
prismock copied to clipboard
`orderBy` date type doesn't work
My query has orderBy a descending date but it doesn't seem like it work.
I did some integration test and confirmed my query is correct so I think it's the orderBy
not working in prismock with date type.
const data = await this.db.test.findMany({
select: {
id: true,
...
},
where: {
...
},
orderBy: {
createdAt: 'desc', // <----- this is a javascripte Date type
},
});
i created a few rows of data with ascending createdAt and when i get the return data in prismock, i still got ascending order, which is not what i expect. Running with real db returns descending order.