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

Skip obsolete snapshot #6120

Closed
Gregoirevda opened this issue May 2, 2018 · 2 comments
Closed

Skip obsolete snapshot #6120

Gregoirevda opened this issue May 2, 2018 · 2 comments

Comments

@Gregoirevda
Copy link

Gregoirevda commented May 2, 2018

Do you want to request a feature or report a bug?
feature

What is the current behavior?

// babelrc (each brand contains it's babelrc)
{
 "alias": {
    "brand": "./brandX"
 } 
}

// Component
import {theme} from 'brand'; // theme specific to babelrc config

export const Component = ({children}) => <Text style={theme}> {children} </Text>;

// Test
test('snapshot',  () => {
 const tree = renderer.create(<MyComponent />).toJSON();
 expect(tree).toMatchSnapshot($BRAND);
});

Outputs a snapshot for each brand, but says all other are obsolete.

What is the expected behavior?
When one app has multibranding, it requires a snapshot of each brand.
The best way to store them next to each other seem to be the argument in toMatchSnapshot function. toMatchSnapshot('someBrand')

I'd like to introduce skipObsolete for that kind of scenarios.
yarn test --skipObsolete
This will not make the CI fail if I'm testing my snapshots against one brand (which is already working), but should not throw that there are obsolete tests

@Gregoirevda
Copy link
Author

Can we use a custom reporter to override that?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants