silverwolf-x's picture
download
raw
741 Bytes
import { cx } from './cx'
describe('cx', () => {
it('should return an empty string for no arguments', () => {
expect(cx()).toBe('')
})
it('should join multiple string arguments with spaces', () => {
expect(cx('foo', 'bar', 'baz')).toBe('foo bar baz')
})
it('should filter out falsy values', () => {
expect(cx('foo', null, 'bar', undefined, 'baz', false)).toBe('foo bar baz')
})
it('should handle single string argument', () => {
expect(cx('foo')).toBe('foo')
})
it('should not add extra spaces when falsy values are between strings', () => {
expect(cx('foo', null, 'bar')).toBe('foo bar')
})
it('should handle all falsy values', () => {
expect(cx(null, undefined, false)).toBe('')
})
})

Xet Storage Details

Size:
741 Bytes
·
Xet hash:
9bcdad1e33134a4ffefce66b40f4949d40e504c2f8ebeaccca84b71cfef5c028

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.