letreverseWordsInString=require('./someFile.js');test('Empty string',()=>{expect(reverseWordsInString("")).toBe("")});test('One word',()=>{expect(reverseWordsInString("hello")).toBe("olleh")});test('Valid string with single spaces',()=>{expect(reverseWordsInString('hello this is devmates!')).toBe('olleh siht si !setamved')});test('Only spaces in string',()=>{expect(reverseWordsInString("")).toBe("")});test('Multiply Spaces at the beginning in given string',()=>{expect(reverseWordsInString(" hello this is devmates!")).toBe(" olleh siht si !setamved")});test('Multiply Spaces at the end in given string',()=>{expect(reverseWordsInString("hello this is devmates! ")).toBe("olleh siht si !setamved ")});test('Multiply spaces at the beginning and at the end in given string',()=>{expect(reverseWordsInString(" hello this is devmates! ")).toBe(" olleh siht si !setamved ")});test('Multiply spaces everywhere in given string',()=>{expect(reverseWordsInString(" hello this is devmates ")).toBe(" olleh siht si setamved ")});
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'll be the first.
Test Cases: