-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from epaew/feature/preset-rules
Refactoring: Replace src/utils/preset-cases with src/utils/preset-rules
- Loading branch information
Showing
16 changed files
with
393 additions
and
343 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
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
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
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 { getRule, presetRules } from '#/utils/preset-rules'; | ||
|
||
describe('getRule', () => { | ||
const subject = getRule; | ||
|
||
describe('when the rule is camelCale', () => { | ||
const rule = 'camelCase'; | ||
|
||
it('returns presetRules.camelCase', () => { | ||
expect(subject(rule)).toEqual(presetRules.camelCase); | ||
}); | ||
}); | ||
|
||
describe('when the rule is not defined in presetRules', () => { | ||
const rule = 'index'; | ||
|
||
it('returns a new object with the field `expression` constructed based on the specified rule.', () => { | ||
expect(subject(rule)).toEqual({ expression: new RegExp(`^${rule}$`) }); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.