Skip to content

chore: migrate tests to vitest #32

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stephancill
Copy link

Summary

Migrated tests to vitest

How did you test your changes?

Ensured all tests are being executed correctly and pass as with jest.

@@ -190,7 +191,7 @@ describe('util', () => {
document.head.innerHTML = `
<link rel="shortcut icon" sizes="16x16 24x24" href="/favicon.ico">
`;
expect(getFavicon()).toEqual('http://localhost/favicon.ico');
expect(getFavicon()).toEqual('http://localhost:3000/favicon.ico');
Copy link
Author

Choose a reason for hiding this comment

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

Not entirely sure if this is acceptable, but in the vitest environment window.location.host includes the port whereas in the jest environment it does not

Comment on lines 7 to 23
const invalidArgsError = (args) =>
standardErrors.rpc.invalidRequest({
standardErrors.rpc.invalidParams({
message: 'Expected a single, non-array, object argument.',
data: args,
});
// @ts-expect-error-next-line
const invalidMethodError = (args) =>
standardErrors.rpc.invalidRequest({
standardErrors.rpc.invalidParams({
message: "'args.method' must be a non-empty string.",
data: args,
});
// @ts-expect-error-next-line
const invalidParamsError = (args) =>
standardErrors.rpc.invalidRequest({
standardErrors.rpc.invalidParams({
message: "'args.params' must be an object or array if provided.",
data: args,
});
Copy link
Author

Choose a reason for hiding this comment

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

There was a mismatch between the returned and expected error code here which was not picked up in jest tests for some reason

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