Some code cleanup, add jest coverage and begin using it for utility functions
This commit is contained in:
parent
ca39830333
commit
1eb3ea2ee4
29 changed files with 2044 additions and 134 deletions
14
resources/scripts/lib/strings.spec.ts
Normal file
14
resources/scripts/lib/strings.spec.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { capitalize } from '@/lib/strings';
|
||||
|
||||
describe('@/lib/strings.ts', function () {
|
||||
describe('capitalize()', function () {
|
||||
it('should capitalize a string', function () {
|
||||
expect(capitalize('foo bar')).toBe('Foo bar');
|
||||
expect(capitalize('FOOBAR')).toBe('Foobar');
|
||||
});
|
||||
|
||||
it('should handle empty strings', function () {
|
||||
expect(capitalize('')).toBe('');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue