Download next.js/packages/next/src/next-devtools/dev-overlay/utils/cx.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 741 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/next-devtools/dev-overlay/utils/cx.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/next-devtools/dev-overlay/utils/cx.test.ts
-
curl -L -o cx.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/next-devtools/dev-overlay/utils/cx.test.ts
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('') | |
| }) | |
| }) | |