-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
chore: migrate to vitest #948
base: v3
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Huge work, thank you! Please, follow the comments and be ready that today I will publish a couple updates and refactoring INCLUDING the async package migration to the vitest, to there will be a small merge conflicts
Also, we use `onConnect` to fetch the list from the server every 5 seconds | ||
and we don't want to call subscriptions extra times so we use `isDeepEqual` | ||
in `withDataAtom` to prevent new reference stream if nothing really changed. | ||
Also, we use onConnect to fetch the list from the server every 5 seconds |
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.
Why the quotes removed?
const INTERVAL = 5 | ||
|
||
const getData = reatomAsync.from(api.getData).pipe( | ||
// add `dataAtom` and map the effect payload into it |
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.
Why the comments removed?
import { take, takeNested } from '@reatom/effects' | ||
import { createTestCtx } from '@reatom/testing' | ||
import { atom } from '@reatom/core' | ||
import { mapToAsync, withDataAtom } from './index' | ||
|
||
export const test = suite('mapToAsync') |
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 is no need to use describe
, please change the tests runner script to this:
"test": "vitest run src/*.test.ts",
"test:watch": "vitest src/*.test.ts"
Understood, I just removed that one describe usage , changed the tests runner script and fixed the comments . Should I change the tests runner scripts to "test": "vitest run src/.test.ts", |
@caio2983 ive updated the deps and the async package tests, please check
yep |
@caio2983 Hi! Sorry for the delay, I have been super busy, working, sick and many other bus factor things :) Are you interested in continuing to work on this PR? I would love to merge it as soon as possible. |
@@ -1,5 +1,4 @@ | |||
import { test } from 'uvu' | |||
import * as assert from 'uvu/assert' | |||
import { describe, it, expect } 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.
btw, you can set up a global: true
in vitest.config and this will allow you to remove all imports 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.
imho direct import is more obvious.
consider to use a workspace feature in vitest which can be useful for monorepo such as reatom |
@artalar I can take over this and continue migration, do you mind? |
@AgarkovRoman ok, go ahead. |
#947
Hello @artalar ,
Please let me know if any changes need to be done in this