Preheat the oven to 400°F (200°C). Cut four pieces of aluminum foil about 14 inches long and set them on a work surface.
Bring a pot of salted water to a boil. Blanch green beans for 3 minutes, then drain in a colander. (If using asparagus, skip blanching.)
Toss the blanched green beans or raw asparagus with 2 tsp olive oil and season with salt and pepper. Divide the vegetables into four portions and place each portion in the center of a foil sheet.
Season both sides of each salmon fillet with salt and pepper. Place one fillet on top of the vegetables on each foil sheet.
Spread 1 Tbsp of pesto over the top of each salmon fillet and drizzle 1 tsp lemon juice over each fillet.
Toss the halved grape tomatoes with the remaining 1 tsp olive oil and a light pinch of salt, then distribute the tomatoes over the salmon fillets.
Fold and crimp the sides of each foil sheet to seal, leaving a little room inside so heat can circulate (do not wrap too tightly). Place the packets seam-side up on a baking sheet.
Bake in the preheated oven until the salmon is cooked through, about 20–28 minutes depending on thickness and desired doneness. Carefully open a packet (watch for steam) and check that salmon flakes easily with a fork.