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: refactor session tests #832

Merged
merged 3 commits into from
Oct 16, 2023
Merged

Conversation

pauldambra
Copy link
Member

Move session recording tests off of given and into typescript

@@ -52,7 +52,10 @@ module.exports = {
// but excluding the 'plugin:compat/recommended' rule
// we don't mind using the latest features in our tests
extends: extend.filter((s) => s !== 'plugin:compat/recommended'),
rules: rules.filter((s) => s !== 'no-console'),
rules: {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't run eslint until changing this

given.sessionRecording._onScriptLoaded()
console_log_enabled_server_side = false
// access private method 🤯
sessionRecording['_onScriptLoaded']()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we interact with private methods quite a lot

  1. it's super easy to have TS ignore that the thing is private 🤣
  2. it didn't seem right to declare them as public or protected only to access them from tests, so this index lookup mechanism instead

@github-actions
Copy link

github-actions bot commented Oct 13, 2023

Size Change: +439 B (0%)

Total Size: 725 kB

Filename Size Change
dist/array.full.js 177 kB +115 B (0%)
dist/array.js 118 kB +108 B (0%)
dist/es.js 118 kB +108 B (0%)
dist/module.js 118 kB +108 B (0%)
ℹ️ View Unchanged
Filename Size
dist/recorder-v2.js 95 kB
dist/recorder.js 58.3 kB
dist/surveys.js 39.4 kB

compressed-size-action

@pauldambra pauldambra merged commit 4af8c2d into master Oct 16, 2023
11 checks passed
@pauldambra pauldambra deleted the chore/refactor-session-tests branch October 16, 2023 19:05
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