In the late 1990s, neuroscientist Jaak Panksepp and colleagues discovered that rats emitted a unique ultrasonic vocalization while playing or anticipating the opportunity to play with other rats. These 50 kHz chirps seemed to indicate a positive emotional state.
What's more, there was another context in which rats emitted the chirps. In the dry language of scientific papers, rats laughed when they were subjected to "playful, experimenter-administered, manual, somatosensory stimulation." In everyday language, rats laughed when they were tickled by the experimenters. In fact, rats emitted more laughter when being tickled by people than during any other activity.
To see whether happy rats were more optimistic, researchers first trained rats to press one lever in response to a tone to receive a morsel of food and to press another lever in response to a different tone to avoid an unpleasant electric foot shock. Once the animals reliably knew which tone signified "Yum, food!" and which tone meant "Ouch, shock!", the rats were divided into two groups. Researchers tickled the rats in one group and simply handled the other rats. Then they presented the rats with an ambiguous tone, in between the food tone and the shock tone.
The tickled rats interpreted the ambiguous tone more optimistically, more often pressing the food-reward lever than the foot-shock avoidance lever. Importantly, it was only the rats that responded to tickling with lots of laughter that showed this optimism. Some rats just don't dig being tickled. For those rats, tickling is not a positive experience and they don't respond to it with laughter.
But those rats that did laugh when tickled were more optimistic, expecting a reward rather than a punishment.