-
Notifications
You must be signed in to change notification settings - Fork 1
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
Basic Vitest implementation #267
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -1,3 +1,3 @@ | |||
export const supportedChainIds = [42069, 31337] as const; | |||
|
|||
export type SupportedChainId = (typeof supportedChainIds)[number]; |
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 related to this PR, but when I pulled main this file was updated. Do we need the parens 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.
Not if it builds without em 👍
|
||
const vitestConfig: VitestUserConfigInterface = { | ||
test: { | ||
// https://vitest.dev/config |
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.
Setup the test config so we can customize it when needed.
@@ -1,3 +1,3 @@ | |||
export const supportedChainIds = [42069, 31337] as const; | |||
|
|||
export type SupportedChainId = (typeof supportedChainIds)[number]; |
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 if it builds without em 👍
package.json
Outdated
@@ -12,6 +12,8 @@ | |||
"dev": "turbo run dev --parallel --filter=./apps/*", | |||
"lint": "turbo run lint", | |||
"lint:packages": "turbo run lint --filter=./packages/*", | |||
"test": "yarn workspace @hyperdrive/core run test", | |||
"test:run": "yarn workspace @hyperdrive/core run test:run", |
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.
minor: top-level package.json shouldn't include any specific project scripts. Let's add just add the test
script, and run it the same way as other scripts here, ie: turbo run test
@@ -0,0 +1,29 @@ | |||
import { multiplyBigInt } from "src/base/multiplyBigInt"; | |||
import { test, assert } 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.
minor: Curious why we're using assert
vs expect
for assertions. I couldn't find any vitest docs about assert
, but there's a whole page for how to use expect
. Did I miss something?
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.
Nice! looks good, couple of small comments
Fixed based on the comments above. Should be able to just run |
This PR implements a basic testing suite using Vitest. I wrote the first test for multiplying bigints