Download wp-calypso/client/server/lib/is-static-request/test/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 690 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/server/lib/is-static-request/test/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/server/lib/is-static-request/test/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/server/lib/is-static-request/test/index.js
690 Bytes
| import isStaticRequest from '..'; | |
| describe( 'isStaticRequest', () => { | |
| it( "returns false if original URL doesn't exist", () => { | |
| expect( isStaticRequest( {} ) ).toBe( false ); | |
| expect( isStaticRequest( null ) ).toBe( false ); | |
| } ); | |
| it( 'returns true if original URL is static', () => { | |
| expect( isStaticRequest( { originalUrl: '/calypso/hello' } ) ).toBe( true ); | |
| expect( isStaticRequest( { originalUrl: '/__webpack_hmr' } ) ).toBe( true ); | |
| } ); | |
| it( 'returns false if original URL is not static', () => { | |
| expect( isStaticRequest( { originalUrl: '/home' } ) ).toBe( false ); | |
| expect( isStaticRequest( { originalUrl: '/post/xyz.wordpress.com' } ) ).toBe( false ); | |
| } ); | |
| } ); | |