File size: 690 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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 );
} );
} );
|