-
Notifications
You must be signed in to change notification settings - Fork 13
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
Test files to ignore list #2
Comments
Yes that would be possible but I'm curious about what pattern is reported by the rule in your test files? Maybe this could be an issue with the rule |
Something like this import { render } from '@testing-library/react';
import MyComponent from './MyComponent';
// here I got an error
// ESLint: Fast refresh only works when a file has exports. Move your component(s) to a separate file.(react-refresh/only-export-components)
const TestChildComponent = ({ children }) => {
return <div>{children}</div>;
};
describe('...', () => {
it('...', async () => {
const { getByText } = render(
<MyComponent>
<TestChildComponent>Demo component</TestChildComponent>
</MyComponent>
);
expect(getByText('Demo component')).toBeInTheDocument();
});
}); |
Oh yeah I see. Yeah this warning makes sense for App entrypoints, but not for test entrypoints. I will skip the linter for those files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
Could you add test files (
*.test.*
,*.spec.*
) to ignore list?The text was updated successfully, but these errors were encountered: