react-code-dataset / next.js /packages /next /src /server /normalizers /request /prefetch-rsc.test.ts
Download next.js/packages/next/src/server/normalizers/request/prefetch-rsc.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 743 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/server/normalizers/request/prefetch-rsc.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/server/normalizers/request/prefetch-rsc.test.ts
-
curl -L -o prefetch-rsc.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/server/normalizers/request/prefetch-rsc.test.ts
743 Bytes
| import { PrefetchRSCPathnameNormalizer } from './prefetch-rsc' | |
| describe('PrefetchRSCPathnameNormalizer', () => { | |
| const normalizer = new PrefetchRSCPathnameNormalizer() | |
| it('should match the prefetch rsc pathname', () => { | |
| expect(normalizer.match('/blog/post.prefetch.rsc')).toBe(true) | |
| }) | |
| it('should not match the prefetch rsc pathname with a different suffix', () => { | |
| expect(normalizer.match('/blog/post.prefetch.rsc2')).toBe(false) | |
| }) | |
| it('should normalize the prefetch rsc pathname', () => { | |
| expect(normalizer.normalize('/blog/post.prefetch.rsc')).toBe('/blog/post') | |
| }) | |
| it('should normalize the prefetch rsc index pathname', () => { | |
| expect(normalizer.normalize('/__index.prefetch.rsc')).toBe('/') | |
| }) | |
| }) | |