The biggest enemy of your pesto is actually air. When the pulverized basil comes into contact with air, it'll begin to oxidize, turning the herb an unappetizing dark brown color. To prevent this, keep the air away! I recommend pressing a piece of plastic wrap down to physically touch the entire surface of the pesto before refrigerating. You can also pour some olive oil over the top, covering the entire surface area of the pesto. Store for up to two weeks.