I believe pesto is just an uncooked sauce. Here is one I adapted years ago from Luciano Pavarotti's guest appearance on the Dinah! Tv show many years ago, and guests have asked for repeat performances, it is so delish.
Whir this in the blender while your spaghetti is cooking...quickly drain but Do Not Rinse! and pour back into the pot. Add pesto and toss very well. The sauce is enough for four big dinner portions. It reheats well for lunches, too.