-
Notifications
You must be signed in to change notification settings - Fork 475
Add Reflame tests #6699
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
Merged
Merged
Add Reflame tests #6699
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vadman97
approved these changes
Sep 28, 2023
lewisl9029
added a commit
to lewisl9029/highlight
that referenced
this pull request
Nov 16, 2023
Implements Reflame's new testing features. :) Currently the only kind of test available are component screenshot tests, where you supply a React component/element, and we'll take a screenshot of it every time you push a commit (and later diff it against the last known good version, skip it if its dependencies hasn't changed, etc). There are two ways to write tests at the moment: 1. Export a React component or element from any module with a _test postfix ([examples](https://github.com/highlight/highlight/pull/6699/files#diff-82085b66646a6df6fc80fb2efc545a69271e0f7f28bbb03c6428d44fdaa2bdbbR33) [here](https://github.com/highlight/highlight/pull/6699/files#diff-0073669d5601b1c655cb637e2d52832d1cce7426584d02315d6df24cc423dc16R20)). Anything with a _test postfix will be eliminated in non-testing builds, and then a dead code elimination pass will be performed, so in theory there shouldn't be leakage of testing-only deps from this. 2. Export a React component or element with any name (except `default`) from a `*.stories.{ts|tsx|js|jsx}` file. This enabled through the storybook compat config, and is why all of the stories in `@highlight-run/ui` are being picked up automatically. Let me know what you think! <!-- Frontend - Leave a screencast or a screenshot to visually describe the changes. --> <!-- Backend - Do we need to consider migrations or backfilling data? --> <!-- Request review from julian-highlight / our design team -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements Reflame's new testing features. :)
Currently the only kind of test available are component screenshot tests, where you supply a React component/element, and we'll take a screenshot of it every time you push a commit (and later diff it against the last known good version, skip it if its dependencies hasn't changed, etc).
There are two ways to write tests at the moment:
Export a React component or element from any module with a _test postfix (examples here). Anything with a _test postfix will be eliminated in non-testing builds, and then a dead code elimination pass will be performed, so in theory there shouldn't be leakage of testing-only deps from this.
Export a React component or element with any name (except
default) from a*.stories.{ts|tsx|js|jsx}file. This enabled through the storybook compat config, and is why all of the stories in@highlight-run/uiare being picked up automatically.Let me know what you think!
How did you test this change?
Are there any deployment considerations?
Does this work require review from our design team?