Download next.js/packages/next/src/shared/lib/page-path/normalize-page-path.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 774 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/shared/lib/page-path/normalize-page-path.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/shared/lib/page-path/normalize-page-path.test.ts
-
curl -L -o normalize-page-path.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/shared/lib/page-path/normalize-page-path.test.ts
774 Bytes
| import { normalizePagePath } from './normalize-page-path' | |
| describe('normalizePagePath', () => { | |
| it('should normalize the page path', () => { | |
| expect(normalizePagePath('/')).toBe('/index') | |
| }) | |
| it('should normalize the page path with a dynamic route', () => { | |
| expect(normalizePagePath('/[locale]')).toBe('/[locale]') | |
| }) | |
| it('should normalize the page path with a dynamic route and a trailing slash', () => { | |
| expect(normalizePagePath('/[locale]/')).toBe('/[locale]/') | |
| }) | |
| it('should normalize the page with a leading index', () => { | |
| expect(normalizePagePath('/index')).toBe('/index/index') | |
| }) | |
| it('should normalize the page with a leading index and suffix', () => { | |
| expect(normalizePagePath('/index/foo')).toBe('/index/index/foo') | |
| }) | |
| }) | |