react-code-dataset / next.js /packages /next /src /next-devtools /shared /webpack-module-path.test.ts
Download next.js/packages/next/src/next-devtools/shared/webpack-module-path.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/next-devtools/shared/webpack-module-path.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/next-devtools/shared/webpack-module-path.test.ts
-
curl -L -o webpack-module-path.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/next-devtools/shared/webpack-module-path.test.ts
1.4 kB
| import { | |
| formatFrameSourceFile, | |
| isWebpackInternalResource, | |
| } from './webpack-module-path' | |
| describe('webpack-module-path', () => { | |
| describe('isWebpackInternalResource', () => { | |
| it('should return true for webpack-internal paths', () => { | |
| expect( | |
| isWebpackInternalResource('webpack-internal:///./src/hello.tsx') | |
| ).toBe(true) | |
| expect(isWebpackInternalResource('webpack://_N_E/./src/hello.tsx')).toBe( | |
| true | |
| ) | |
| expect(isWebpackInternalResource('webpack://./src/hello.tsx')).toBe(true) | |
| expect(isWebpackInternalResource('webpack:///./src/hello.tsx')).toBe(true) | |
| }) | |
| it('should return false for non-webpack-internal paths', () => { | |
| expect(isWebpackInternalResource('<anonymous>')).toBe(false) | |
| expect(isWebpackInternalResource('file:///src/hello.tsx')).toBe(false) | |
| }) | |
| }) | |
| describe('formatFrameSourceFile', () => { | |
| it('should return the original file path', () => { | |
| expect(formatFrameSourceFile('webpack-internal:///./src/hello.tsx')).toBe( | |
| './src/hello.tsx' | |
| ) | |
| expect(formatFrameSourceFile('webpack://_N_E/./src/hello.tsx')).toBe( | |
| './src/hello.tsx' | |
| ) | |
| expect(formatFrameSourceFile('webpack://./src/hello.tsx')).toBe( | |
| './src/hello.tsx' | |
| ) | |
| expect(formatFrameSourceFile('webpack:///./src/hello.tsx')).toBe( | |
| './src/hello.tsx' | |
| ) | |
| }) | |
| }) | |
| }) | |