-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI: Fix eslint configuration for strings
- Loading branch information
Showing
2 changed files
with
35 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { describe, it, expect, vi } from 'vitest'; | ||
import { normalizeExtends } from './eslintPlugin'; | ||
|
||
describe('normalizeExtends', () => { | ||
it('returns empty array when existingExtends is falsy', () => { | ||
expect(normalizeExtends(null)).toEqual([]); | ||
expect(normalizeExtends(undefined)).toEqual([]); | ||
}); | ||
|
||
it('returns existingExtends when it is a string', () => { | ||
expect(normalizeExtends('foo')).toEqual(['foo']); | ||
}); | ||
|
||
it('returns existingExtends when it is an array', () => { | ||
expect(normalizeExtends(['foo'])).toEqual(['foo']); | ||
}); | ||
|
||
it('throws when existingExtends is not a string or array', () => { | ||
expect(() => normalizeExtends(true)).toThrowError('Invalid eslint extends true'); | ||
}); | ||
}); |
This file contains 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