-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests #116
Add tests #116
Conversation
Besutiful! Is the changed argument order a breaking change? |
@hirasso No, swup currently accepts both old and new hook argument order. This change just updates to the current canonical order. |
@hirasso Ah, I misread your question. The updated arguments are for the call to |
Ah ok 👌 |
{ | ||
"public": "tests/fixtures", | ||
"cleanUrls": false, | ||
"redirects": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the redirects directive here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently don't test the expected behavior for redirected requests, but I think we should. For example, 302 redirects probably shouldn't preload, but we don't know the exact status code, so we should discard all redirected responses anyway.
'tests/unit/**/*.test.ts' | ||
], | ||
setupFiles: [ | ||
'tests/config/vitest.setup.ts' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this here so we can quickly use it should we need it sometime later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so — let's merge this for now, and then do a more thorough review when comparing all plugins with e2e tests.
@@ -0,0 +1,13 @@ | |||
import { vi } from 'vitest'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused right now – leaving it here for future usage?
I guess all my comments about unused stuff also apply to fragment plugin :) ...no big deal, we can totally leave it in. |
Description
Checks
master
branchnpm run lint
)npm run test
)The documentation was updated as requiredRequired changes
touchstart
to work properly 🤔page:preload
hook