prismock icon indicating copy to clipboard operation
prismock copied to clipboard

`orderBy` date type doesn't work

Open jeniii opened this issue 6 months ago • 0 comments

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.

jeniii avatar Aug 06 '24 17:08 jeniii