-
Notifications
You must be signed in to change notification settings - Fork 129
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: downgrade jest types #1442
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: 0 B Total Size: 2.8 MB ℹ️ View Unchanged
|
@@ -1,12 +1,22 @@ | |||
/* eslint-disable compat/compat */ | |||
import { v4 } from 'uuid' |
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.
uuid package is incompatible in some way with jest 28+ and we don't need it, we only use it in this file, so we can uuidv7 instead
async function shortWait() { | ||
// no need to worry about ie11 compat in tests | ||
// eslint-disable-next-line compat/compat | ||
await new Promise<void>((resolve: () => void) => setTimeout(resolve, 500)) | ||
} | ||
|
||
describe('FunctionalTests / Feature Flags', () => { | ||
let token: string | ||
|
||
beforeEach(() => { | ||
token = uuidv7() | ||
}) |
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.
a little tidying while we're in here
let token: string | ||
let posthog: PostHog | ||
let anonymousId: string | ||
|
||
beforeEach(async () => { | ||
token = uuidv7() | ||
posthog = await createPosthogInstance(token) | ||
anonymousId = posthog.get_distinct_id() | ||
}) |
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.
same same, a little tidying since we're removing uuid from here
"@testing-library/preact": "^3.2.4", | ||
"@types/eslint": "^8.44.6", | ||
"@types/jest": "^29.5.1", | ||
"@types/jest": "^27.5.1", |
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.
the fix we came here to make
"@types/web": "^0.0.154", | ||
"@typescript-eslint/eslint-plugin": "^8.2.0", | ||
"@typescript-eslint/parser": "^8.2.0", | ||
"babel-eslint": "10.1.0", |
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.
clearly not using this
"@types/node": "^22.5.0", | ||
"@types/react-dom": "^18.0.10", | ||
"@types/sinon": "^17.0.1", | ||
"@types/uuid": "^9.0.1", |
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.
was weird that we were importing a function from a types package anyway
we have jest types v29 and jest v27
this led me down a path of confusion where the types suggested you could do something you couldn't really
trying to upgrade to jest 29 caused one of those cascading error -> upgrade -> sadness cycles
let's downgrade the types package instead