Download wp-calypso/packages/explat-client/src/test/index.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 806 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/explat-client/src/test/index.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/explat-client/src/test/index.ts
-
curl -L -o index.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/explat-client/src/test/index.ts
806 Bytes
| import { | |
| createExPlatClient as createBrowserExPlatClient, | |
| createSsrSafeDummyExPlatClient, | |
| } from '../create-explat-client'; | |
| import { setBrowserContext, setSsrContext } from '../internal/test-common'; | |
| beforeEach( () => { | |
| jest.resetModules(); | |
| } ); | |
| describe( 'index.ts', () => { | |
| it( 'should return the real client when run in a browser context', () => { | |
| setBrowserContext(); | |
| const exPlatIndex = require( '../index' ); | |
| expect( exPlatIndex.createExPlatClient.toString() ).toBe( | |
| createBrowserExPlatClient.toString() | |
| ); | |
| } ); | |
| it( 'should return the mock client when run outside of a browser context', () => { | |
| setSsrContext(); | |
| const exPlatIndex = require( '../index' ); | |
| expect( exPlatIndex.createExPlatClient.toString() ).toBe( | |
| createSsrSafeDummyExPlatClient.toString() | |
| ); | |
| } ); | |
| } ); | |