Download wp-calypso/client/test-helpers/config/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 361 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/test-helpers/config/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/test-helpers/config/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/test-helpers/config/index.js
361 Bytes
| import config from '@automattic/calypso-config'; | |
| export const setFeatureFlag = ( feature, val ) => { | |
| const c = config; | |
| let spy; | |
| beforeAll( () => { | |
| spy = jest | |
| .spyOn( config, 'isEnabled' ) | |
| .mockImplementation( ( feat ) => ( feat === feature ? val : c.isEnabled( feat ) ) ); | |
| } ); | |
| afterAll( () => { | |
| spy.mockReset(); | |
| spy.mockRestore(); | |
| } ); | |
| }; | |