Skip to content
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

Merged
merged 4 commits into from
Sep 28, 2024
Merged

chore: downgrade jest types #1442

merged 4 commits into from
Sep 28, 2024

Conversation

pauldambra
Copy link
Member

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

Copy link

vercel bot commented Sep 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Sep 28, 2024 4:49pm

Copy link

github-actions bot commented Sep 28, 2024

Size Change: 0 B

Total Size: 2.8 MB

ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 191 kB
dist/array.full.js 351 kB
dist/array.full.no-external.js 350 kB
dist/array.js 166 kB
dist/array.no-external.js 165 kB
dist/exception-autocapture.js 10.5 kB
dist/external-scripts-loader.js 2.35 kB
dist/main.js 167 kB
dist/module.full.js 351 kB
dist/module.full.no-external.js 350 kB
dist/module.js 166 kB
dist/module.no-external.js 165 kB
dist/recorder-v2.js 111 kB
dist/recorder.js 111 kB
dist/surveys-preview.js 59.8 kB
dist/surveys.js 66 kB
dist/tracing-headers.js 8.36 kB
dist/web-vitals.js 10.3 kB

compressed-size-action

@@ -1,12 +1,22 @@
/* eslint-disable compat/compat */
import { v4 } from 'uuid'
Copy link
Member Author

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

Comment on lines +6 to +17
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()
})
Copy link
Member Author

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

Comment on lines +11 to +19
let token: string
let posthog: PostHog
let anonymousId: string

beforeEach(async () => {
token = uuidv7()
posthog = await createPosthogInstance(token)
anonymousId = posthog.get_distinct_id()
})
Copy link
Member Author

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",
Copy link
Member Author

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",
Copy link
Member Author

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",
Copy link
Member Author

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

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.

2 participants