Skip to content

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.

<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