UNPKG

js-essential-kit

Version:

This library provides a comprehensive set of utility functions for various common tasks, including date calculations, formatting, masking, normalizing data, and validation

20 lines (16 loc) 581 B
import { normalizeName, arrayToStringWithQuotes } from '../lib/normalize' describe('normalizeName', () => { test('normalize a name with mixed cases', () => { expect(normalizeName('john DOE')).toBe('John Doe') }) test('normalize a name with extra spaces', () => { expect(normalizeName(' alice SMITH ')).toBe('Alice Smith') }) }) describe('arrayToStringWithQuotes', () => { test('convert an array of strings to quoted string', () => { expect(arrayToStringWithQuotes(['apple', 'banana', 'cherry'])).toBe( '"apple", "banana", "cherry"' ) }) })