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 |
| }); | ||
|
|
||
| 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.
This test had the same name as the previous one but different content.
| const [primaryPane, setPrimaryPane] = useState<PrimarySideBarPane>('Explorer'); | ||
| const openReference = useSetAtom(openReferenceAtom); | ||
|
|
||
| function handleSideBarClick(selectedPane: PrimarySideBarPane) { |
There was a problem hiding this comment.
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.
What is wrong with that? Is there any other advantages of using function expression? (I know that is easier to define the function).
| }); | ||
|
|
||
| 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.
The consistent-test-it rule says to use it inside describe blocks and test outside.
There was a problem hiding this comment.
That's ok. Thanks for the bulk rename :-).
|
|
||
| const [collapsibleBlock] = collapsibleBlocks; | ||
| expect(getText(collapsibleBlock)).toEqual('Some content'); | ||
| expect(getText(collapsibleBlock)).toBe('Some content'); |
There was a problem hiding this comment.
| }, | ||
| ]; | ||
| }, | ||
| parseHTML: () => [ |
There was a problem hiding this comment.
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.
| expect(getText(content.child(2))).toBe('Content Line 2'); | ||
| }); | ||
|
|
||
| test('should add a new content line to an uncollapsed collapsible block', () => { |
There was a problem hiding this comment.
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.