Ejemplo n.º 1
0
		test( 'when strings are formed correctly', () => {
			expect( getWords( 'Modern Tribe' ) ).toEqual( [ 'Modern', 'Tribe' ] );
			expect( getWords( 'The Next Generation of Digital Agency' ) )
				.toEqual( [ 'The', 'Next', 'Generation', 'of', 'Digital', 'Agency' ] );
			expect( getWords( 'A list with numbers: 1, 2, 3' ) )
				.toEqual( [ 'A', 'list', 'with', 'numbers:', '1,', '2,', '3' ] );
		} );
Ejemplo n.º 2
0
		test( 'Two words last separator is applied', () => {
			expect( wordsAsList( getWords( 'Modern Tribe' ) ) ).toEqual( 'Modern & Tribe' );
			expect( wordsAsList( getWords( 'Events Calendar' ), ',', ' - ' ) )
				.toEqual( 'Events - Calendar' );
		} );
Ejemplo n.º 3
0
		test( 'Words with multiple spaces on it', () => {
			expect( getWords( '       Modern       Tribe       ' ) ).toEqual( [ 'Modern', 'Tribe' ] );
		} );