Remove the white spaces after the last new line
" \n\n\n ".stripEndToken.should.equal(" \n\n"); " \r\n\r\n\r\n ".stripEndToken.should.equal(" \r\n\r\n"); " a \n\n\n a ".stripEndToken.should.equal(" a \n\n\n a "); " b \r\n\r\n\r\n a ".stripEndToken.should.equal(" b \r\n\r\n\r\n a "); "\ntest\n".stripEndToken.should.equal("\ntest"); " ".stripEndToken.should.equal(" ");