-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: master
Are you sure you want to change the base?
Conversation
@@ -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'); |
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.
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
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, | ||
}); |
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.
There was a mismatch between the returned and expected error code here which was not picked up in jest tests for some reason
1e283a3
to
499a15d
Compare
Summary
Migrated tests to vitest
How did you test your changes?
Ensured all tests are being executed correctly and pass as with jest.