-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add vitest and arrow eslint plugins #185
Conversation
Codecov Report
@@ Coverage Diff @@
## main #185 +/- ##
==========================================
- Coverage 66.06% 65.83% -0.23%
==========================================
Files 87 87
Lines 4370 4338 -32
Branches 323 322 -1
==========================================
- Hits 2887 2856 -31
+ Misses 1466 1465 -1
Partials 17 17
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -22,7 +22,7 @@ describe('chatWithAI', () => { | |||
expect(response).toStrictEqual(['some reply']); | |||
}); | |||
|
|||
test('should return list of strings with content returned by sidecar', async () => { | |||
it('should return list of strings with content returned by sidecar 2', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test had the same name as the previous one but different content.
@@ -47,7 +47,7 @@ function LeftSidePanelWrapper() { | |||
const [primaryPane, setPrimaryPane] = useState<PrimarySideBarPane>('Explorer'); | |||
const openReference = useSetAtom(openReferenceAtom); | |||
|
|||
function handleSideBarClick(selectedPane: PrimarySideBarPane) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function statements inside other functions are frowned upon because they're hoisted, just like variables declared with var
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is wrong with that? Is there any other advantages of using function expression? (I know that is easier to define the function).
@@ -10,7 +10,7 @@ describe('chatWithAI', () => { | |||
vi.clearAllMocks(); | |||
}); | |||
|
|||
test('should return list of strings with content returned by sidecar', async () => { | |||
it('should return list of strings with content returned by sidecar', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The consistent-test-it rule says to use it
inside describe
blocks and test
outside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's ok. Thanks for the bulk rename :-).
@@ -19,19 +19,19 @@ describe('Chevron input rule handler', () => { | |||
expect(collapsibleBlocks).toHaveLength(1); | |||
|
|||
const [collapsibleBlock] = collapsibleBlocks; | |||
expect(getText(collapsibleBlock)).toEqual('Some content'); | |||
expect(getText(collapsibleBlock)).toBe('Some content'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, | ||
]; | ||
}, | ||
parseHTML: () => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind the left-hand side of this diff, but using arrow functions does allow you to drop the return
for the common case of a one-liner.
}); | ||
|
||
test('should add a new content line to an uncollapsed collapsible block', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an exact duplicate of the previous test.
This adds two new eslint plugins:
This was prompted by discovering two tests with the same name in #186.