Skip to content

Conversation

socsieng
Copy link
Contributor

Still a WIP progress while I try to familiarise myself with expected behaviour, but wanted some early feedback on the approach for now.

expect(response.statusCode).not.toEqual(404);
});

it("should redirect trailing slashes", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan on being able to provide mock implementations for things like redirects to test different redirect behaviours.

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before you go any further, i'll give my advice on this.
We shouldn't unit test big component like this routingHandler file, we should rather test the little function used inside like addNextConfigHeaders or fixDataPage

For me we should keep as little mock as possible, because otherwise at one point you risk end up testing against your mock instead.
And we also risk having to provide thousands of mock to cover all the test we need.

We could maybe reconsider this later and add integration test, but the priority right now is these small function

@socsieng
Copy link
Contributor Author

Closing this PR and replacing with #568

@socsieng socsieng closed this Oct 17, 2024
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.

2 participants