Download wp-calypso/client/layout/guided-tours/test/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 512 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/layout/guided-tours/test/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/layout/guided-tours/test/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/layout/guided-tours/test/utils.js
512 Bytes
| import { and } from 'calypso/layout/guided-tours/utils'; | |
| describe( 'Guided Tours utilities: and()', () => { | |
| test( 'returns true when all passed callbacks are truthy', () => { | |
| const a = () => true; | |
| const b = () => 1; | |
| const c = () => 'a string'; | |
| expect( and( a, b, c )() ).toEqual( true ); | |
| } ); | |
| test( 'returns false when one or more callbacks are not truthy', () => { | |
| const a = () => true; | |
| const b = () => 0; | |
| const c = () => 'a string'; | |
| expect( and( a, b, c )() ).toEqual( false ); | |
| } ); | |
| } ); | |