Skip to content

Conversation

@jadejr
Copy link

@jadejr jadejr commented Jan 3, 2025

This is just some random work I did to attempt to make the tests pass and the logic make more sense to me.
I doubt you'll want to accept all of this, but at least the tests are on their way to passing. page-factory.spec.ts does pass, while the decorator tests do not.

I can split this out into more useful bits if you're interested.

I'm a bit stuck on making the paginator decorator tests pass because there are too many different names and usages
related to limit, itemsPerPage, and size.

The README suggests that limit should effectively be like pageSize (or itemsPerPage) as many offset paginators use , while the e2e tests treat limit as a total result limit.

I could really use some insight here to finish this off.

Johnny Robeson added 21 commits December 30, 2024 05:10
…ogic :(

I don't quite get the logic here, so this could totally be wrong
This could be controversial, but it made the link building code easier
to understand for me.
… output

I'm not sure if if it's worth doing it this way, but at least it helps
the test pass.
@jadejr
Copy link
Author

jadejr commented Jan 4, 2025

now all the tests pass again

@jadejr
Copy link
Author

jadejr commented Jan 4, 2025

One thing I noticed is that you can't reasonably use iso dates in queries like $gte:2025-01-04T09:57:06.284Z' or anything where the content includes a : because the filter code just does raw.split(operandSeperator); which will consume it.

Johnny Robeson added 7 commits January 4, 2025 06:56
We might wanna use a real request mock if we need more vars
…ven necessary)

This is probably not necessary if i could understand what the most
complex valid filter query could look like, then the operator parsing
itself could be improved instead.
Currently you have to change the comment out
`app = await NestFactory.create<NestExpressApplication>(ApplicationModule, new ExpressAdapter(), { logger: false });`
and uncomment
`app = await NestFactory.create<NestFastifyApplication>(ApplicationModule, new FastifyAdapter(), { logger: false })`

To complete this, we need to pass a variable to jest to decide which one to use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant